[SOLVED] Decoding uart data

Status
Not open for further replies.

raman00084

Full Member level 6
Joined
Nov 29, 2010
Messages
375
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Activity points
4,076
How can I decode the uart data recived from slave device to pic micro

The start is $
End is <CR>

What is the value of <CR>
How to check the recived character is <CR>

 

<CR> is shorthand for "Carriage Return" which is ASCII value 13 in decimal or 0x0D in hexadecimal.
So what you have to do is look for a "$" then capture the next characters until a <CR> is found. Exactly how you get the characters depends on how the UART is set up and how you decode it depends on what the data is.

Brian.
 

    raman00084

    Points: 2
    Helpful Answer Positive Rating
OK I will try thank you
 

What is the value of <CR>
An internet search will bring you many million hits.
Almost every ASCII table will show.

You don´t say which programming language you use ... but almost any language provides a shortcut...
Example: in C you may use the "/r" ...

The only difficult thing is that the definition of "CRLF" may vary. Some only use CR other s us LF and others really CRLF.
Liek alway... When in doubt: read the documentation

Klaus
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…