Receive response from sim900 (connected to pic18f252 micro)

Status
Not open for further replies.

RaminGsm

Newbie level 4
Joined
May 12, 2012
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,346
hello
i design a pic18f252 board to connect with a sim900 board. i can send and receive data to/from computer with my picmicro(baud:9600 8N1None).also i can connect ma sim900 module to pc with rs232 serial(baud:9600 8N1None).but when i connect picmicro board to sim900 module and send (AT+0x0D+0x0A) to sim900,H receive AT instead OK.
please help me.
thank you.
 

try sending it this way "AT\r" and it will respond!

---------- Post added at 06:31 ---------- Previous post was at 06:29 ----------

the response depends on your settings for ECHO back of characters and i guess thats On , so you would recieve
HTML:
AT
OK
 

thank you
my program is :
#define LED1 PORTA.B0
#define LED2 PORTA.B1
#define Buzzer PORTB.B4

char receive;
void main()
{
int i=1;
TRISA.B0=0;
TRISA.B1=0;
TRISB.B4=0;
TRISC.B6=0;
TRISC.B7=1;
UART1_Init(9600);
delay_ms(400);
UART1_Write("A");
delay_ms(10);
UART1_Write("T");
delay_ms(10);
UART1_Write("E");
delay_ms(10);
UART1_Write("0");
delay_ms(10);
UART1_Write(0X0D);
UART1_Write(0X0A);
delay_ms(200);
UART1_Write_Text("AT\r\n");
delay_ms(200);

while(i==1)
{ //First while loop
if(UART1_Data_Ready()==1)
{
receive = UART1_Read();
switch( receive ){
case 'O':
case 'K':
LED2=1;
break;
case 'A':
case 'T':
Buzzer=1;
break;
case 'E':
case 'R':
{
Buzzer=1;
DELAY_MS(100);
Buzzer=0;
}
break;
default:
LED1=1;
break;
}
}
}
}

in this case LED1 goes on and micro doesn't get OK.
in correct response LED2 must be On.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…