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.

how to manipulate Uart data frame

Status
Not open for further replies.

zulkifliaziz

Junior Member level 1
Joined
Mar 27, 2008
Messages
18
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,409
Hi,

I've a problem whereby i do not know how to do the right way. I got multiple analog input to my PIC18f452. These analog inputs are from AN0-AN6. All these inputs read from 0-5V. All these analog inputs than being converted into Digital. These digital numbers then being sent to PC via uart. How can i manipulate these data so that, when i received these data i can select to show it at specific column in the PC. pls help. Thanks
 

I would suggest you format the analog readings into CSV format so they can be read as text or directly into a spreadsheet. You would need to send AN0 reading, a comma, AN1 reading, a comma, and so on for all seven readings. Depending on your application, it may be easiest to send the "raw" ADC value and do any conversion back to voltage in PC software rather than convert it before sending it.

Brian.
 

it may be easiest to send the "raw" ADC value and do any conversion back to voltage in PC software rather than convert it before sending it.

Hi brian, based on what you saying in the quote i highlighted, i can send the raw data no problem. But the issue is that, how that the software recognize that each data send is belong to the specific column. all the data send is look the same. i mean it send the value of 1-255.
 

Split the data into lines by putting a delimiter in it somewhere. For example, use a carriage return at the end of each line:

data1,data2,data3,data......, data 10, data11,CR

The CR will tell it to move to the next line of the spreadsheet.

Alternatively, you can use a special value to indicate the start of data, you must use something that is unique and doesn't appear in the data itself. For example in one of my designs I use the ASCII 'STX' (0x02) character at the start of each line then send the data as a string of comma separated ASCII strings. Like this: STX,"-123.45","+456.78","-0.001","+5642.00" The PC program looks for the STX code and uses it to start a new line.

Brian.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top