LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to decode uart Tx (Rx) analog waveform?

Solved!
Go to solution

I have PCIe-6321 NI card, I am measuring uart Tx (Rx) pin with maximum sampling rate 250KHz getting analog waveform.

How I can decode this waveform into characters sending over uart with known baud rate and format (115200 8N1 in my specific case)?

 

For example, here is my waveform for character "1" (31Hex):

SergeS_0-1666217612410.png

 

"2" (32Hex):

SergeS_1-1666217682469.png

 

AA Hex character:

SergeS_2-1666218140222.png

 

55 Hex character:

SergeS_3-1666218225718.png

 

 

Is this even possible with 250K sampling rate? 

Anybody ever done such thing? Anybody can share VI?

0 Kudos
Message 1 of 6
(3,879 Views)

@SergeS wrote:

Is this even possible with 250K sampling rate? 

Yes, but just barely so. I guess you are familiar with Nyquist-Shannon? You typically want to do some Oversampling.

 

Anybody ever done such thing? Anybody can share VI?


Why would you want to do that? Is this for a practical application, troubleshooting, homework, or curiosity?

0 Kudos
Message 2 of 6
(3,842 Views)

It is for practical application, I would like to test uart communication between some devices so I have captured waveform on Rx-Tx lines.

I have setup some limits for voltage and timing, but it would be beneficiary for me to decode data and to compare with known data I am sending over.

 

Yes, I am familiar with Nyquist-Shannon criteria, according to it I am on the edge, in "gray" zone,  that is why I am asking is this even possible...

Anybody can share?

 

0 Kudos
Message 3 of 6
(3,810 Views)

@SergeS wrote:

It is for practical application, I would like to test uart communication between some devices

 


In that case, I recommend using a logic analyzer or RS-232 sniffer. There are also oscilloscopes that can automatically decode the bytes for you. Even hooking up an RS-232-USB-adapter or an Arduino might do the trick. This will probably be more robust (and cheaper) than reverse-bit-banging it yourself.

0 Kudos
Message 4 of 6
(3,793 Views)
Solution
Accepted by topic author SergeS

I would rather get a USB-FTDI adapter and use the FTDI libraries for robustness - saves you a lot of engineering time and effort.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 5 of 6
(3,776 Views)

Ok, thanks to all answered.

I have already FTDI USB adapter, I just would think somebody will offer already existing VI 🙂

0 Kudos
Message 6 of 6
(3,715 Views)