Microcontroller › 8051 › about gsm interfacing › helloi passed that
hello
i passed that hurdle….am getting the response now…i modified the code to suit my needs now…. instead of sending AT i modified it to send, ATD phoneno the code is as follows….
//
#include<regx51.h>
#define port P1
#define dataport P2 // Data port for LCD
sbit rs = port^2;
sbit rw = port^3;
sbit en = port^4;
int count,i;
unsigned char check,str[15];
bit check_space;
void init_serial() // Initialize serial port
{
TMOD=0x20; // Mode2
TH1=0xfd; // 9600 baud
SCON=0x50; // Serial mode=1 ,8-Bit data,1 Stop bit ,1 Start bit, Receiving on
TR1=1; // Start timer
}
void delay(unsigned int msec) // Function for delay
{
int i,j;
for(i=0;i<msec;i++)
for(j=0; j<1275; j++);
}
void lcd_cmd(unsigned char item) // Function to send command on LCD
{
dataport = item;
rs= 0;
rw=0;
en=1;
delay(1);
en=0;
return;
}
void lcd_data(unsigned char item) // Function to display character on LCD
{
dataport = item;
rs= 1;
rw=0;
en=1;
delay(1);
en=0;
return;
}
void lcd_data_string(unsigned char *str) // Function to display string on LCD
{
int i=0;
while(str!=’