Sign In

Trouble In Receiving IMEI Of GSM Number In LCD Through PIC18F4550

Nitish from Hermes Techno researchathermes@gmail.com India

Hardware: PIC18F4550 With 20MHz Xstal Embedded Board Software: C Project In MPLab With XC8 Compiler

hello sir,
i am working on GSM SIM800 with Microchip PIC18F4550 controller project. The C programme is done in MPLab. i am already done with simple AT command that gives OK response in 16x2_LCD. Now i want to get IMEI number of SIM800 GSM module on LCD by transmitting command AT+GSN (enter i.e. 0X0D). I have also posted my C code of this. i tried hard,but did not get IMEI number. please kindly help me as soon as possible.


Thanking you in advance...

Images

Program

* here all includes files
    and 
   pragmas

void DELAY(unsigned int x)
{
    int p=0,q=0;
    for(p=0;p<x;p++)
    {
        for(q=0;q<1000;q++)
        {           
        }
    }
}



void main(void)
{
    
    unsigned char serial_data;
    unsigned int i=0;
 
    unsigned char data;
 
   uart_init();
    lcd_on();
   
    
    ADCON1 = 0x0F;      
    PORTA = 0x00;
   
 while(1)
   {    
        DELAY(2);
            serial_data='A';    // Receive data from PC
            tx_data(serial_data); 
    
        DELAY(2);
            serial_data='T';
            tx_data(serial_data); 
     
        DELAY(2);
            serial_data='+';
            tx_data(serial_data);
            
        DELAY(2);
            serial_data='G';
            tx_data(serial_data); 
            
        DELAY(2);
            serial_data='S';
            tx_data(serial_data); 
            
        DELAY(2);
            serial_data='N';
            tx_data(serial_data); 
       
        DELAY(2);
             serial_data= 0x0D;
             tx_data(serial_data);  

             
             while(1)
                 {     
                  
                     data = rx_data();

                     if((data >= 0x30) && (data <= 0x39))
                         {                                                 
                            lcd_data(data);
                            DELAY(2);   
                         }                   
                 }
   }   




}

Replies

R Avinash
2016-12-23 11:11:37
Post a picture of what you are getting on the LCD

Post a reply to Nitish from Hermes Techno

Think you can help Nitish from Hermes Techno ? Then post your thoughts that might help Nitish from Hermes Techno. You will earn a lot of reputation in the technical community.

If your program is in multiple files, then ZIP the entire folder and attach below

Images and Screenshots

These helps other better understand your suggestion.