htcompany
Junior Member level 2
Hello,
i am using SIM800 GSM modem to interface with PIC18F4550 Controller for the sending and receiving msg/call. But here, i am unable to receive simple AT command also, so plz help me for the Code.
For the reference i am pasting my code plz help me out asap. Thanks in advance.
i am using SIM800 GSM modem to interface with PIC18F4550 Controller for the sending and receiving msg/call. But here, i am unable to receive simple AT command also, so plz help me for the Code.
For the reference i am pasting my code plz help me out asap. Thanks in advance.
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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 #include <xc.h> #include "uart.h" #include "lcd.h" unsigned char data; void delay(unsigned int t) { int p,q; for(p=0;p<t;p++) for(q=0;q<2000;q++) {} } void main() { ADCON1 = 0x0F; TRISB = 0xF0; INTCON2bits.RBPU = 0; lcd_on(); // initialisation of LCD lcd_command(CLRSCR); // to clear LCD uart_init(); TRISA = 0; PORTA = 0xFF; lcd_command(CLRSCR); // Clear LCD screen delay(5); lcd_write_string("Tx:"); tx_data('A'); // Sending 'A' to GSM module tx_data('T'); // Sending 'T' to GSM module lcd_data('A'); lcd_data('T'); delay(2); tx_data(0x0D); // Sending carriage return to GSM module delay(2); delay(1); tx_data('A'); // ATE0 is gsm command tx_data('T'); // to disable echo in receiver */ tx_data('E'); tx_data('0'); tx_data(0X0D); // Hex value for "Enter" lcd_write_string_xy(9,0,"Rx:");//space(); while(1) { data = rx_data(); delay(10); if((data=='O') || (data=='K') || (data=='A') || (data== 't')) { delay(2); lcd_data(data); } } }
Last edited by a moderator: