View previous topic :: View next topic |
Author |
Message |
thangapandi
Joined: 27 Aug 2012 Posts: 6 Location: Madurai
|
Facing problem while reading GSM modem with pic16f877a |
Posted: Mon Aug 27, 2012 2:48 am |
|
|
in starting of "GSM modem with TTL output",modem will send RDY,+CFUN: 1,+CPIN: NOT READY like as follows
0x0d 0x0a R D Y 0x0d 0x0a
0x0d 0x0a + C F U N : 1 0x0d 0x0a
0x0d 0x0a + C P I N : N O T R E A D Y 0x0d 0x0a
Through PIC i am able to read only upto " 0x0d 0x0a R D Y ".Remaining i am not able to read.i dont know what is the problem.
baud rate i used : 9600,null modem |
|
|
ALI_726
Joined: 15 Aug 2012 Posts: 4 Location: Pakistan
|
Re: Facing problem while reading GSM modem with pic16f877a |
Posted: Mon Aug 27, 2012 5:21 am |
|
|
thangapandi wrote: | in starting of "GSM modem with TTL output",modem will send RDY,+CFUN: 1,+CPIN: NOT READY like as follows
0x0d 0x0a R D Y 0x0d 0x0a
0x0d 0x0a + C F U N : 1 0x0d 0x0a
0x0d 0x0a + C P I N : N O T R E A D Y 0x0d 0x0a
Through PIC i am able to read only upto " 0x0d 0x0a R D Y ".Remaining i am not able to read.i dont know what is the problem.
baud rate i used : 9600,null modem |
Hello, I have read your problem. I can help you for GSM coding and hardware issues. Feel free to ask any question or help about GSM modem. |
|
|
ezflyr
Joined: 25 Oct 2010 Posts: 1019 Location: Tewksbury, MA
|
|
Posted: Mon Aug 27, 2012 9:22 am |
|
|
Hi,
Actually, this is a forum for the CCS 'C' compiler, so if your GSM modem
question is not directly related to a CCS based project then you should
not feel free to ask your questions here, but rather you should find a
more appropriate forum.
John |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19513
|
|
Posted: Mon Aug 27, 2012 9:32 am |
|
|
Actually, he is talking about having problems reading the result with a PIC (so hopefully CCS), unlike the other poster asking a GSM question.
My guess would be the input routines are not allowing for the line feed character. This is a common problem when parsing the data from modems. If you use the 'gets' function, the second return, will have an extra '0xa' at the front, making the string one character longer than expected, and the characters won't be in the locations expected.
I'd suggest two things:
1) Search the forum archives. There have been a lot of code pieces posted in the past showing approaches to this.
2) Assuming you _are_ using CCS, post the simplest possible code example showing what you are trying.
Best Wishes |
|
|
thangapandi
Joined: 27 Aug 2012 Posts: 6 Location: Madurai
|
|
Posted: Mon Aug 27, 2012 10:26 pm |
|
|
I am using CCS compiler. I will post my sample code which I tried soon. |
|
|
ezflyr
Joined: 25 Oct 2010 Posts: 1019 Location: Tewksbury, MA
|
|
Posted: Wed Sep 05, 2012 11:21 pm |
|
|
Well, it looks like I was correct, this really wasn't a CCS 'C' related question after all..... No code posted, no CCS version number given, so you've been called out!
John |
|
|
thangapandi
Joined: 27 Aug 2012 Posts: 6 Location: Madurai
|
|
Posted: Thu Sep 06, 2012 2:31 am |
|
|
problem got resolved,code implemented as follows
getch() //0x0d
getch() //0x0a
gets() //RDY + 0x0d
getch() //0x0a |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19513
|
|
Posted: Thu Sep 06, 2012 2:35 am |
|
|
So, it was the extra line feed.
It is a common problem, with things sending line feed, plus carriage return, while gets, as implemented, only wants carriage return.
Best Wishes |
|
|
|