Extracting response from TC35i GSM using PIC16f690

Discussion in 'The Projects Forum' started by White Coral, May 4, 2011.

  1. White Coral

    Thread Starter New Member

    May 4, 2011
    1
    0
    Hi all,

    I am now trying to extract the response from TC35i GSM using pic16f690. When I send "AT" to GSM, the GSM suppose to give me an "OK" response. However, the PIC16f690 cannot receive the response properly. I actually use MAX232 to connect GSM with PIC and I use another MAX232 to connect PIC with Hyperterminal. From Hyperterminal I can see the received response from the GSM. From the result, I know that instead of receiving only an "OK", the PIC will also receive the echo of "AT". Below is my code,

    for(j=0; j<2; j++)
    {
    TXREG=C[j]; // Sending "AT"
    for(i=0; i<500; i++) // Delay
    {
    }
    }

    TXREG = 0x0D; // Sending "Enter"

    if (RCREG=='T') // If receive "T"
    {
    PORTC = 0x01; // LED will turn on
    }

    Even if i try with RCREG=='O' or RCREG=='K', the LED will not turn on. How to make PIC16f690 be able to read the response from GSM correctly?

    I need your help earnestly. I will truly appreciate any help from you guys. Thank you so much.
     
Loading...