Pic18F4550 + SIMCOM SIM900D GSM/GPRS


Closed Thread
Results 1 to 39 of 39

Hybrid View

  1. #1
    Join Date
    Jun 2011
    Location
    Philippines
    Posts
    223

    Default Re: Pic18F4550 + SIMCOM SIM900D GSM/GPRS( a little sign of progress)

    Quote Originally Posted by pedja089 View Post
    Check does it send correctly with HT. Use your usb ttl uart converter board.
    Try to send CRLF then pause 100, and then send command...
    On the SERIAL COMMUNICATORl, sending AT commands had no problems( w/ CR and CRLF).
    Name:  CRLF.png
Views: 16114
Size:  65.6 KB

    Regards,
    tacbanon

  2. #2
    Join Date
    Jun 2011
    Location
    Philippines
    Posts
    223

    Default Re: Pic18F4550 + SIMCOM SIM900D GSM/GPRS( a little sign of progress)

    I tried other serial communicator, and I'm not sure if I found the trouble...
    Name:  WithNewLine.png
Views: 16077
Size:  46.5 KB
    When I disable the Append New Line

    Name:  WithNewLine2.png
Views: 16193
Size:  47.5 KB
    With New line after sending

    Do you think adding new line after each send will solve it - how?

    Code:
    HSEROUT ["AT",13] 
    HSERIN 4000, GSM_CHECK_ERR, [WAIT("OK")]
    The code above does not detect "OK".

    regards,
    tacbanon

  3. #3
    Join Date
    Sep 2009
    Posts
    755

    Default Re: Pic18F4550 + SIMCOM SIM900D GSM/GPRS( a little sign of progress)

    Try to connect PC to PIC, instead of modem...
    Also use Rx on PC board to sniff what is happening when pic and modem communicate...

  4. #4
    Join Date
    Jun 2011
    Location
    Philippines
    Posts
    223

    Default Troubleshooting...

    I tried to modify my hardware setup to detect whats going IN and OUT in the GSM module (below). I test each button(Button1-Button3) and each corresponding response of the GSM shown in the serial communicator.
    Name:  pic_gsm_pc_view.png
Views: 14969
Size:  40.6 KB

    I noticed that everything seems normal..but when I tried the connection PIC-GSM... I have the same issue.
    So sending PIC to GSM AT commands is not issue..I think when receiving incoming data from GSM to PIC is where the trouble is.

    Regards,
    tacbanon

  5. #5
    Join Date
    Jun 2011
    Location
    Philippines
    Posts
    223

    Default Re: Troubleshooting...

    I noticed that everything seems normal..but when I tried the connection PIC-GSM... I have the same issue.
    What I meant was, when I set the entire connection between PIC-GSM I have the trouble again(need to press the reset button on my Labx2 devboard)

  6. #6
    Join Date
    Jun 2011
    Location
    Philippines
    Posts
    223

    Default Re: Troubleshooting...

    For testing I removed all HSERIN command to see if it will continue each line. And below is the results.
    Name:  anothertest.png
Views: 15988
Size:  32.1 KB
    Here is the code I'm using...
    Code:
     asm
        __CONFIG    _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
        __CONFIG    _CONFIG1H, _FOSC_HSPLL_HS_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
        __CONFIG    _CONFIG2L, _PWRT_ON_2L & _BOR_ON_2L  & _BORV_2_2L  & _VREGEN_ON_2L   
        __CONFIG    _CONFIG2H, _WDT_OFF_2H 
        __CONFIG    _CONFIG3H, _MCLRE_ON_3H & _LPT1OSC_OFF_3H & _PBADEN_OFF_3H & _CCP2MX_ON_3H 
        __CONFIG    _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _ICPRT_OFF_4L  & _XINST_OFF_4L & _DEBUG_OFF_4L 
    endasm
    
            
            DEFINE OSC 48
      
    
            DEFINE HSER_RCSTA 90h ' enable serial port, 
            DEFINE HSER_TXSTA 20h  ' enable transmit, * we change 20h to 36 for 115200          
            DEFINE HSER_BAUD 9600
            DEFINE HSER_CLOERR  1 ' automatic clear overrun error  
            
            TRISC  = %10000000    ' PORTC.7 is the RX input, PORTC.6 is the TX output
                                  
        
        '   Serial communication definition
        '   ===============================
            '
    ADCON1 = %00001111      'Set up ADCON1 register no matter what you're doing!!!!!!
    '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    
    INCLUDE "MODEDEFS.BAS"       ' Include Shiftin/out modes
    
    
    '*****************************************************************************     
    
    
    INTCON2.7 = 0        ' Enable PORTB pull-ups
    
    TRISB = %11111000
    TRISC = %10000000
    led1 var PortC.0
    cntr var byte
    cntr = 0
    TRISD = %00000000
    
     
    Serout2 PORTD.5, 84, [$1B,$63,$30]  
    Serout2 PORTD.5, 84, [$1B,$45, "Start GSM SIMU"]   ' Serial LCD
    main:
    
    PAUSE 1000
    HSEROUT ["AT",13,10]                    'Send AT to modem followed by a CR
    pause 200
    cntr=cntr+1
    Serout2 PORTD.5, 84, [$1B,$45,"Start GSM SIMU"]
    Serout2 PORTD.5, 84, [$D,"AT -Done",#cntr]
    cntr=cntr+1
    
    pause 1000
    HSEROUT["AT+CMGF=1",13]             'Here the GSM module is being entered in TEXT MODE.
    PAUSE 1000
    HSEROUT ["AT+CSQ",13,10]                    
    pause 200
    Serout2 PORTD.5, 84, [$1B,$45,"Start GSM SIMU"]
    Serout2 PORTD.5, 84, [$D, "SIGNAL CHK",#cntr]
    
    
    PAUSE 1000
    HSEROUT ["AT+CGMI",13,10]                           'Ask model name
    pause 200
    cntr=cntr+1
    Serout2 PORTD.5, 84, [$1B,$45,"Start GSM SIMU"]
    Serout2 PORTD.5, 84, [$D, "MANUFACT CHK",#cntr]
    
    Pause 1000
    Serout2 PORTD.5, 84, [$1B,$45,"Start GSM SIMU"]
    Serout2 PORTD.5, 84, [$D,"GSM TEST DONE!",#cntr]
    
    End     ' End of program
    Can anyone pin point what I'm doing wrong in my code..and why HSERIN is not detecting data coming out from GSM?
    I Appreciate any help.

    Thanks in advance,
    tacbanon

  7. #7
    Join Date
    Sep 2009
    Posts
    755

    Default Re: Troubleshooting...

    Maybe problem is in supply voltage. Modem works on 2.8V(it have internal regulator), so pic should work on 3.3V, and you must have serial resistor on pic TX. So modem can't draw any current from pic TX pin.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts