tritech
Newbie level 6
- Joined
- Apr 16, 2013
- Messages
- 14
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,403
PIC : PIC18F4520
PICPLC16v6 Development Board from Mikroelectronika
GSM Modem : Quectel M95
Individually tested serial communication of PIC Board with Hyperterminal -> OK
Checked AT command response in Hyperterminal with GSM Modem -> OK
Now I need to integrate both together.
I wrote a simple code to obtain the OK response if I send AT. But I do not get OK response.
char rcv[10];
void main()
{
UART1_Init(9600);
Delay_ms(2000);
TRISB=0x00;
UART1_Write_Text("at");
UART1_Write(13); //Enter key = CF + LF
UART1_Write(10);
delay_ms(500);
while (1)
{ PORTB.RB0=1; // Endless loop
while(!UART1_Data_Ready()); // If data is received,
rcv[0]=UART1_Read();
rcv[1]=UART1_Read();
rcv[2]='\0';
UART1_Write_Text(rcv);
PORTB.RB0=0;
}
}
I get the response as attt.
Pls let me know the mistake. Thanks
PICPLC16v6 Development Board from Mikroelectronika
GSM Modem : Quectel M95
Individually tested serial communication of PIC Board with Hyperterminal -> OK
Checked AT command response in Hyperterminal with GSM Modem -> OK
Now I need to integrate both together.
I wrote a simple code to obtain the OK response if I send AT. But I do not get OK response.
char rcv[10];
void main()
{
UART1_Init(9600);
Delay_ms(2000);
TRISB=0x00;
UART1_Write_Text("at");
UART1_Write(13); //Enter key = CF + LF
UART1_Write(10);
delay_ms(500);
while (1)
{ PORTB.RB0=1; // Endless loop
while(!UART1_Data_Ready()); // If data is received,
rcv[0]=UART1_Read();
rcv[1]=UART1_Read();
rcv[2]='\0';
UART1_Write_Text(rcv);
PORTB.RB0=0;
}
}
I get the response as attt.
Pls let me know the mistake. Thanks