ashwija
Newbie level 1
hi...,
we r facing a problem while interfacing gsm wit 8051, we r able to interface gsm with pc n 8051 wit pc , but we are not able interface microcontroller wit gsm module..plz help us
here is our code
we r facing a problem while interfacing gsm wit 8051, we r able to interface gsm with pc n 8051 wit pc , but we are not able interface microcontroller wit gsm module..plz help us
here is our code
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 #include<at89x51.h> // include at89x51 . h #include<stdio.h> // include stdio . h #include<stdlib.h> // include stdlib . h unsigned char Command_CMGF[]="AT+CMGF=1\r"; // AT+CMGF for selecting Text Mode unsigned char SUB[]="0x1A"; //# define C Ctrl^Z // CTRL+Z for sedning SMS after the message has been entered unsigned char Command_CMGS[]="AT+CMGS =+919590166616\r"; // recepient mobile number unsigned char Command_AT[]="AT\r"; unsigned char msg02[]="Hello!"; void delay2(){ unsigned int i; for(i=0;i<25000;i++); } void initialize_serialcommunication(){ TMOD = 0x20; SCON = 0x50; TH1 = 0xFD; TL1 = 0xFD; TR1 = 1; TI = 1; } void initialize_GSM_modem(){ delay2(); puts(Command_AT); delay2(); puts(Command_CMGF); delay2(); puts(Command_CMGS); delay2(); puts(msg02); delay2(); while(!TI); TI=0; SBUF= "^Z"; //SBUF=0X1A; //SBUF=SUB; } void main () { initialize_serialcommunication(); initialize_GSM_modem(); while (1) { ; } }
Last edited by a moderator: