Electronic – Using GPIO mode in SIM908

gpiopicsim900

I'm working on a SIM908 module using GPIO mode (my rx pin contact is lost when soldering).
I have interfaced it with a PIC16F73 and while using GPIO mode I'm not getting any response. I have included an LCD to print the response. Is there any AT command or pins I should enable on SIM908 to activate GPIO mode or is it because there should be a delay between writing and reading on the ports?

I have included the code:

   char x[20], y[20];
   TRISB = 0x00;
   PORTB = 'A';
   PORTB = 'T';
   PORTB = '\r';
   TRISB = 0xff;
   x[0] =  PORTB;

   LCD_Print_String(2,1,x[0]);

    if (x[0] == 'O')
    {
        LCD_Print_String(1,1,"done");
    }
    else if(x[0] == 'E')
    {
        LCD_Print_String(1,1,"error");
    }

    while(1);

sim908 datasheet:http://www.synes.co.th/nicupload/20111109110456.pdf

Best Answer

Reading through the datasheet I can't see any mention of being able to use the GPIO for sending AT commands and data. I suspect where you've read about using the GPIO for communications they're referring to say attaching a switch which could be viewed as communicating the switch's state to the module. Apart from that there are a number of holes in just trying to connect six GPIO lines and attempting to send ASCII data:

  1. From your example the character "A" in ASCII has a decimal value of 65 or 1000001 in binary. That is 7 bits long so you'll be dropping part of the character, the same will apply for any ASCII value of 64 or higher which includes all uppercase and lowercase letters.

  2. Parallel data transfer schemes typically need additional lines apart from just data lines. For example you might have something like R/W to indicate if data is being read or written, RDY to make sure the device is ready for a transfer and ACK to indicate the data has been transferred.

There is mention that the SPI and I2C interfaces can be used for AT commands and communications but only if you have custom firmware. That sounds like something you would have to pay for them to develop rather than something available off the shelf.

I think with the broken RXD line you might be out of luck unless you're able to repair it. You might have some luck with a scalpel to carefully scrape off some of the solder mask and soldering on a piece of wire wrap wire or perhaps a single strand of wire from some multi-strand wire, assuming there is some amount of track left before it gets to the RF shield.