I am trying to connect my GSM modem sim300 with my PIC 16F877A but it is not working. I tried my modem with few AT commands with my PC and it works fine. I tried communicating with my PIC using my PC and it worked fine. BUT everything stops working when I connect my PIC to my Modem.
I use MAX 232 converter. Connection are as follows:
PIC PortC.6 ---> MAX 232 Pin-11
PIC PortC.7 ---> MAX 232 Pin-12
Modem Pin2 - Max 232 Pin-13
Modem Pin3 - Max 232 Pin-14
Modem Pin5 - Common Ground with PIC
My code is as follows:
As you can see in the code, upon receipt of "OK" Led at portb.7 should go low, but it never does.Code:DEFINE OSC 4 ADCON1=7 CMCON=7 INTCON=0 OPTION_REG.7=0 TRISA=0 : PORTA=0 TRISB=0 : PORTB=0 TRISC=%10000000 : PORTC=0 TRISD=0 : PORTD=0 TRISE=0 : PORTE=0 CCP1CON=0 DEFINE DEBUG_REG PORTC DEFINE DEBUG_BIT 6 DEFINE DEBUG_BAUD 4800 DEFINE DEBUG_MODE 0 DEFINE DEBUGIN_REG PORTC DEFINE DEBUGIN_BIT 7 DEFINE DEBUGIN_MODE 0 high portb.7 check: DEBUG "AT",13,10 DEBUGIN 5000,check,[WAIT("OK")] : pause 500 Low PortB.7 end
I don't know if I am communicating right with right connections and baud rate settings or my modem is faulty (can't be as it works with my PC)
When I connect the Modem to my PIC I do have to make sure in Flow-control option "Hardware" is selected, otherwise I don't see anything on my Hyperterminal screen.
I searched on the net about disabling this option and I found one command "AT+IFC=0,0". I tried that as well but it is still not working with my PIC.


)


Bookmarks