coolvasanth07
Member level 1
sir,
i am doing my project gsm modem interfacing with pic 16f877a+hitech c...i have done to sending sms,,but now problam with receiving sms...so plz help me....how to i receive sms using interruts...this is my code...
thanks in advance..........
i am doing my project gsm modem interfacing with pic 16f877a+hitech c...i have done to sending sms,,but now problam with receiving sms...so plz help me....how to i receive sms using interruts...this is my 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 void main() { serial_init(); gsm_init(); while(1); } void gsm_init() { delay(); serial_string(cmd_AT); delay(); serial_string(cmd_CMGF); delay(); serial_string(cmd_CNMI); delay(); serial_string(cmd_CMGS); delay(); serial_string(msg); delay(); while(TXIF==0); TXREG=0x1A; } void serial_init() { TXSTA=0x20; RCSTA=0x90; SPBRG=15; SPEN=1; RCIE=1; GIE=1; PEIE=1; } void serial_string(unsigned char name[]) { unsigned char i=0; while(name[i]!='\0') { while(TXIF==0); TXREG=name[i]; i++; } } void interrupt isr(void) { if (RCIF==1); Read_msg(); } void Read_msg(void) { unsigned char res_char; res_char=RCREG; RCIE=0; serial_string(cmd_CMGR); delay(); RCIE=1; }
thanks in advance..........
Last edited by a moderator: