Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help needed: GSM/GPRS modem and PIC

Status
Not open for further replies.

adaan

Newbie level 1
Newbie level 1
Joined
Jun 25, 2009
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
South Africa
Activity points
1,301
olimex pic gsm source code

Hello,

Please help me, I am interfacing a GSM/GPRS modem with a PIC16f887 microcontroller using assembly language.
I can successfully send SMS messages using the PIC, but I can't receive any modem repsonse.
With modem echo ON I only receive "At" and with modem echo OFF I only receive CR LF, when I am expecting an OK.

Part of my receive routine:


Code:
INCF BufferSize,1
BANKSEL PIR1
BTFSS PIR1,RCIF
GOTO $-1
banksel RCREG
movf RCREG, W       
movwf RXchr	
goto BUFFER_ROUTINE
 

Hi Addan,
Im having the same problem between a Pic and GSM module
The tx(pic) to rx(gsm) works well, and i can call and sends sms.
And the tx(gsm) is sending the data, but i only read CR LF (13 10) with the buffer=getc().

Please help me... :(
I have crushing my head for a few days already and still, don't find the problem.

Thanks ;D
Rodrigo
 

Re: olimex pic gsm source code

Did you succeed to solve the problem? Because I also fall into this problem.
Thx
 
Last edited:

Re: olimex pic gsm source code

Yes, just use the RTS communication line to keep both brains (module gsm and pic) in sync... Also add a little dalay (about 10 us) after every serial communicaction line...
And it worked...
Good luck with your project.
Rodrigo
 
Re: olimex pic gsm source code

Could you explain how I should use the RTS line? At this moment I connect the PIC RX <- GSM TX, PIC TX -> GSM RX. I tried pull up the RTS but it does not help.
Thank you
Johnni21
 

Re: olimex pic gsm source code

Could you explain how I should use the RTS line? At this moment I connect the PIC RX <- GSM TX, PIC TX -> GSM RX. I tried pull up the RTS but it does not help.
Thank you
Johnni21

Ok,
You have to change the value of RTS, i don't remember when (0 or 1) is ready to recived the next serial communication, but you have to change the state of RTS when you are ready with the analisis...
Search the web to know how the rts pin works.
Good Luck
Rodrigo
 

Re: olimex pic gsm source code

But if I see the OK answer in the hyperterminal, why I don't see on the pin of the PIC? I connect only the RX and TX pin onthe PIC side, and on the PC side.
 

Re: olimex pic gsm source code

But if I see the OK answer in the hyperterminal, why I don't see on the pin of the PIC? I connect only the RX and TX pin onthe PIC side, and on the PC side.

Because th PC works different that the pic, and the PC can solved the communication syncc problem by itself... and the PIC can not...
And thats why you have to use the control line request to send (RTS)...
The value of RTS tells DCE to prepare to accept data from DTE.
Connect the rts line to any I/O pin of the pic and conect it to the RTS pin of the gsm module...
output_low(RTS); // Enables the gsm module to send data
output_high(RTS); // disables the communication from the module... it waits the info to send until the rts line is low again....
Good luck
Rodrigo
 

Re: olimex pic gsm source code

But I would like to leave out the PC from the circuit. In this case I connect the serial pins (TX, RX) PIC<->GSM, then GSM RTS to an I/O pin of the PIC. Is it good?
 

Re: olimex pic gsm source code

But I would like to leave out the PC from the circuit. In this case I connect the serial pins (TX, RX) PIC<->GSM, then GSM RTS to an I/O pin of the PIC. Is it good?

Yes, that's correct (the connection)
And you have to change the value of the RTS line to tell the gsm module when to send data and when not.
Bye bye
 

Re: olimex pic gsm source code

I did what you suggest me, but it didn't help. It seems that I only get back the first and the second characters from all characters. I set the echo, I get the "AT" and no CR LF.
But I check the OERR after every ReadUSART, but there is not overrun.
 

Re: olimex pic gsm source code

I did what you suggest me, but it didn't help. It seems that I only get back the first and the second characters from all characters. I set the echo, I get the "AT" and no CR LF.
But I check the OERR after every ReadUSART, but there is not overrun.

Strange... it should be the problem... my problem was the same and i fix it with that...
Try to put some delays (10us) after every communication line in your program
Good Luck
Rodrigo
 

Re: olimex pic gsm source code

Tell the truth, I don't use the olimex, I connect pic18f45k20 -> M33G GSM module (both 3.3V). But the problem is the same "i only read CR LF". I tried to pull up the RX and TX pin with 47k resistor. Tried to connect RTS to CTS, then DSR to DTR, but nothing. I tried to write the RX usart handle with interrupt. But the result is the same. I don't know.
Thank you
Johnni21
 

Re: olimex pic gsm source code

Tell the truth, I don't use the olimex, I connect pic18f45k20 -> M33G GSM module (both 3.3V). But the problem is the same "i only read CR LF". I tried to pull up the RX and TX pin with 47k resistor. Tried to connect RTS to CTS, then DSR to DTR, but nothing. I tried to write the RX usart handle with interrupt. But the result is the same. I don't know.
Thank you
Johnni21

I don't know if your pic communication lines include rts cts, etc... but mine didn't so i just connect RTS (form the gsm module) to the RB1 and control the value (0 or 1) of that pin by software. (I used pic18f2550)
Good luck
 

mga master pahelp nmn poh pg-interface ng sim900d gsm modem sa PIC16f877a
,tapos poh mgdisplay nmn poh sa lcd ung sim load menu....my keypad dn poh...
,pwd nmn poh cguro iinterface lht un s isang PIC lng db?

:???::?:
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top