CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Facing problem while reading GSM modem with pic16f877a

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
thangapandi



Joined: 27 Aug 2012
Posts: 6
Location: Madurai

View user's profile Send private message

Facing problem while reading GSM modem with pic16f877a
PostPosted: Mon Aug 27, 2012 2:48 am     Reply with quote

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

View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger

Re: Facing problem while reading GSM modem with pic16f877a
PostPosted: Mon Aug 27, 2012 5:21 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Aug 27, 2012 9:22 am     Reply with quote

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: 19469

View user's profile Send private message

PostPosted: Mon Aug 27, 2012 9:32 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Aug 27, 2012 10:26 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Sep 05, 2012 11:21 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Sep 06, 2012 2:31 am     Reply with quote

problem got resolved,code implemented as follows

getch() //0x0d
getch() //0x0a
gets() //RDY + 0x0d
getch() //0x0a
Ttelmah



Joined: 11 Mar 2010
Posts: 19469

View user's profile Send private message

PostPosted: Thu Sep 06, 2012 2:35 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group