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

CR/LF (Carriage retrun/ Line Feed) as a combination

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



Joined: 25 Nov 2003
Posts: 3

View user's profile Send private message ICQ Number

CR/LF (Carriage retrun/ Line Feed) as a combination
PostPosted: Sat Apr 17, 2004 10:20 am     Reply with quote

Hi

Can somebody tell me how to look for a string combination [CR][LF]. I just can't let the PIC18F6720 detect the GPS stream end with only a [CR] or [LF].
The trimble GPS datasheet state the following:
"[CR][LF]: The carriage return [CR] and line feed [LF] combination terminate the message."

How can this be detected??

Thanks
Willie
Charlie U



Joined: 09 Sep 2003
Posts: 183
Location: Somewhere under water in the Great Lakes

View user's profile Send private message

PostPosted: Sat Apr 17, 2004 10:36 am     Reply with quote

The carriage return is 0x0D and the line feed is 0x0A. As your data is received, check each byte for a 0x0D and then if the next byte is 0x0A, the received data string has been terminated.

Is this what you were looking for? If so, I hope this helps.

Also check www.asciitable.com for the ASCII character codes.
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