Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
7 years, 11 months ago.
i want to interface sim900a with stm32f401re for my home automation project,please help me.
i want to interface sim900a with stm32f401re for my home automation project but i don't able to interface it,so please help me.My code is
/* Working Ports -> PC_6, PC_7 -> PA_9, PA_10
- /
- include "mbed.h" Serial pc(USBTX,USBRX); Serial gsm(PA_9,PA_10); DigitalOut led(LED1);
int main() { pc.baud(9600); gsm.baud(9600); gsm.printf("AT+CMGF=1\r"); pc.printf("AT\n"); wait(0.5); gsm.printf("AT+CMGS=\"+91908xxxxxxx\"\r"); pc.printf("AT+CMGS=\"+9194xxxxxxxx\"\n"); wait(0.5); gsm.printf("test"); gsm.putc( char(26) );/* int i=0; do{ c[i]=gsm.getc(); pc.putc(gsm.getc()); i++;wait(0.5);led=!led; }while(1); pc.printf("%s",c);*/ return 0; }
1 Answer
7 years, 11 months ago.
It's been a while since I played with Sim900, but what I'd recommend is first testing that the UART interface works. If I recall right when you send "AT", you should get a reply "OK".
What you should now do is upload a UART bridge program to the STM32 and try to enter AT commands manually. If you do get replies the issue is not in the UART itself.