GSM sim900 shield stopped responding||how to reset the GSM module to factory settings?

523 Views Asked by At

I'm using the GPRS/GSM SHIELD SIM900 module which is designed to interface with Arduino board, specifically this kind GSM sim900

I have a hex file(I will call it hex file 1) which was working correctly when communicating with the GSM module via AT89s52 microcontroller, I got the hex file from this link. The GSM module was responding with "OK" respond after serially transmitting "ATE0". I then used a different hex file(let's call it hex file number 2) generated from the below-mentioned code and that is when the GSM stopped responding, ....then now when I use the first hex file(hex file number 1) the module no longer responds to ATE0 or any command but when I call the GSM number from my phone it rings, could it be that the module is destroyed or having some sort of software bug, and how can I fix it? I've already reset the module using the hardware rest pin, but it still doesn't respond.

#include <reg52.h>

unsigned char *NUMBER = "+27738849014" ;         //Here insert your number where you want to send message

void ser_init();
void tx(unsigned char send);
void tx_str(unsigned char *s);
unsigned char rx();

void sms(unsigned char *num1,unsigned char *msg);
void gsm_delay();

unsigned int dell;

int main()
{
        ser_init();
        
        sms(NUMBER, "Welcome to the Embetronicx");
        while(1);
}

void ser_init()
{
  SCON=0x50;
  TMOD=0x21;
  TH1=0xFD;
  TL1=0xFD;
  TR1=1;
}

void tx(unsigned char send)
{
  SBUF=send;
  while(TI==0);
  TI=0;
}

void tx_str(unsigned char *s)
{
  while(*s)
    tx(*s++);
}

unsigned char rx()
{
  while(RI==0);
  RI=0;
  return SBUF;
}

void gsm_delay()
{
  unsigned int gsm_del;
  for(gsm_del=0;gsm_del<=50000;gsm_del++);
}

void sms(unsigned char *num1,unsigned char *msg)
{
  tx_str("AT");
  tx(0x0d);
  gsm_delay();

  tx_str("AT+CMGF=1");
  tx(0x0d);
  gsm_delay();

  tx_str("AT+CMGS=");
  tx('"');
  while(*num1)
    tx(*num1++);
  tx('"');
  tx(0x0d);
  gsm_delay();

  while(*msg)
    tx(*msg++);
  tx(0x1a);
  gsm_delay();
}

I also made a simulation of the circuit diagram on Proteus and the GSM module on Proteus responds correctly(to hex file number 1) but the same hex file no longer gets a response on the physical circuit. Here is what the circuit looks likecircuit diagram drawn on Proteus simulation-software

0

There are 0 best solutions below