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.

[SOLVED] Decoding uart data

Status
Not open for further replies.

raman00084

Full Member level 6
Full Member level 6
Joined
Nov 29, 2010
Messages
372
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Activity points
4,062
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>

IMG-20240906-WA0011.jpg
 

<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
<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.
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

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top