drtvskuthsav
Member level 2
Dear All,
I was trying to send AT Commands to SIM900 using Serial Communication. Here is My code. It is not working. Please help me with it. Please find the mistakes and correct them.
Baudrate=9600
My module is set for auto baudrate.
I was trying to send AT Commands to SIM900 using Serial Communication. Here is My code. It is not working. Please help me with it. Please find the mistakes and correct them.
Baudrate=9600
My module is set for auto baudrate.
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 #include <mega32.h> #include <stdio.h> #include <stdlib.h> #asm .equ __lcd_port=0x18 ;PORTB #endasm #include <lcd.h> #include <delay.h> void ustx(void) { UDR=0x0d; UDR=0x0a; } void srtx(void) { UDR=0x1a; } void main(void) { UCSRA=0x00; UCSRB=0x08; UBRRH=0x00; UBRRL=0x33; lcd_puts("hello"); printf("A"); delay_ms(5000); printf("AT"); ustx(); delay_ms(2500); printf("AT+IPR=9600"); ustx(); delay_ms(2500); printf("AT"); ustx(); delay_ms(2500); printf("AT+CMGF=1"); ustx(); delay_ms(2500); printf("AT+CSMP=17,167,0,241"); ustx(); delay_ms(2500); printf("AT+CMGS=\"9566809793\""); ustx(); delay_ms(2500); printf("Hello!!"); srtx(); ustx(); delay_ms(2500); }
Last edited by a moderator: