aravinl
Junior Member level 1
- Joined
- Mar 6, 2017
- Messages
- 18
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 125
Hi,
I am new to all of this. I am a student.I have been trying to interface SIM808 with PIC18f4580.I tried to debug the code using PICkit3 debugger. I sent (ATE0) command to turn OFF echo mode after sending (AT) command. I am using LCD to display the response from SIM808.
The problem is whatever I sent is getting back i.e., ECHO mode is not turning OFF.
For transmitting I used the below function:
void tx_data(unsigned char serial_data) // Transmit data function
{
while(PIR1bits.TXIF==0);
TXREG=serial_data;
}
For receiving I used the below function:
void interrupt SerialRxPinInterrupt()
{
while(!PIR1bits.RCIF);
data[j]= RCREG; // Store the data into array when Reception interrupt occurs
j++;
}
When I send "AT", the LCD should display "OK" instead it displays "AT".
Plz help me with this.I have been trying this for 2 weeks. I will rejoice if I get a quick response.
Thanks in advance.
- - - Updated - - -
Also when I am sending data from PIC to SIM808,first two characters are properly sent.After that TXIF(=0x00) flag is remaining CLEARED for a long time.The TXIF flag is taking a lot of time to get SET(0x01) after first two characters of sending data.
I am new to all of this. I am a student.I have been trying to interface SIM808 with PIC18f4580.I tried to debug the code using PICkit3 debugger. I sent (ATE0) command to turn OFF echo mode after sending (AT) command. I am using LCD to display the response from SIM808.
The problem is whatever I sent is getting back i.e., ECHO mode is not turning OFF.
For transmitting I used the below function:
void tx_data(unsigned char serial_data) // Transmit data function
{
while(PIR1bits.TXIF==0);
TXREG=serial_data;
}
For receiving I used the below function:
void interrupt SerialRxPinInterrupt()
{
while(!PIR1bits.RCIF);
data[j]= RCREG; // Store the data into array when Reception interrupt occurs
j++;
}
When I send "AT", the LCD should display "OK" instead it displays "AT".
Plz help me with this.I have been trying this for 2 weeks. I will rejoice if I get a quick response.
Thanks in advance.
- - - Updated - - -
Also when I am sending data from PIC to SIM808,first two characters are properly sent.After that TXIF(=0x00) flag is remaining CLEARED for a long time.The TXIF flag is taking a lot of time to get SET(0x01) after first two characters of sending data.