Author Topic: Calculated UART Baud Rate Does not Match the Baud Rate Expected by the Receiver  (Read 568 times)

0 Members and 1 Guest are viewing this topic.

Offline KalciferTopic starter

  • Regular Contributor
  • *
  • Posts: 82
  • Country: ca
I am trying to decode a software UART from a microcontroller on my oscilloscope. To do this, I am probing the Tx line with reference to ground, and using the decode feature on my oscilloscope (Siglent SDS 1104X-E). To configure the UART on the oscilloscope side, I have to choose a custom baud rate, as the baud rate of my software UART isn't fine tuned properly. To do this, I measure the period of a bit in the UART data. Then, using the period I simply divide 1bit by the period to get a value in bps.

For example, in some UART data that I had sent, I measured the length of 1 bit to be 0.2208ms, so

(1 bit) / (0.2208 * 10^(-3) s) ~= 4529 bps

I then set the custom baud rate on my oscilloscope to this value, and press the decode button expecting to see a nicely decoded signal; however, the receiver appears to have received garbage as seen below

https://imgur.com/a/xMyAuT4


What confuses me is that if I dial down the baud rate to around 4200 Baud, the signal is decoded perfectly as seen below

https://imgur.com/a/NihQgJ9


This value is so far off from the actual baud rate that I calculated from the signal, so what is going on here? The data is accurate and clean, but the baud rate required for decoding it is so far off.

I would also like to note that I don't believe that this is an issue with the oscilloscope, because when I send the data to my PC through an FTDI breakout, and monitor it with

Code: [Select]
screen /dev/ttyUSB0 4529
I receive garbage data. The characters received are unknown and result as the unknown ascii character symbol; however what's different in that scenario is that even if I change around the baud rate for `screen`, it is still unable to decode the data no matter what I change it to. What's even weirder with that is that I am receiving the correct number of characters for whatever I send, its just the characters themselves are for some reason unrecognizable, even though the oscilloscope can decode them fine. So I am very perplexed as to what is going on here.

P.S. If someone could tell me how to insert inline pictures in these posts, I would be very grateful.
P.P.S. I know that I already posted this in "Projects, designs, and Technical Stuff"; I was unsure which sub-forum was the best one to put this in.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Even if you are unsure, still don't cross post.
Alex
 

Offline KalciferTopic starter

  • Regular Contributor
  • *
  • Posts: 82
  • Country: ca

Even if you are unsure, still don't cross post.
fair enough. I will remove this.


EDIT: hm it appears that I am unable? It says I cant remove my own posts from this board.
« Last Edit: May 06, 2021, 05:58:18 am by Kalcifer »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf