0
\$\begingroup\$

I tried to transmit "S" using De0 nano FPGA board and UART over USB module . The problem is i am not receiving "s" constantly . I am using the software Called Hterm to see receiving data.

When i remove the USB to UART module from the PC and reconnect the receiving value changes.

enter image description here

  1. After removing the Module and plug it again the value changes. enter image description here
  2. And after this is received "S" enter image description here
\$\endgroup\$
4
  • 1
    \$\begingroup\$ I'm not familiar with Verilog, but can you reduce your sending interval... lets say to 1 Hz? \$\endgroup\$ – po.pe Dec 30 '20 at 8:13
  • \$\begingroup\$ @jsotola i checked the binary value of that , Both were matched . \$\endgroup\$ – Unpared Electron Dec 30 '20 at 8:21
  • \$\begingroup\$ @po.pe But that should be consider as solving this error right. I need 115200 baud rate \$\endgroup\$ – Unpared Electron Dec 30 '20 at 8:23
  • 1
    \$\begingroup\$ The baud rate has nothing to do with the repetition rate... for now. \$\endgroup\$ – po.pe Dec 30 '20 at 9:31
9
\$\begingroup\$

The problem is sending constant data stream without any pauses between symbols.

The ASCII symbol 'S' has a value of 0x53, so it is sent over the wire as repeating pattern of 0110010101 which includes the start and stop bits.

Because there is no pauses between transmissions, the receiving UART does not know which bits are the start and stop bits in the constant data stream, so it may synchronize to any wrong but valid-looking point in the stream.

There are 4 combinations of valid symbols when sending out ASCII letter 'S' constantly. In addition to the 'S', they are the following:

0101011001 is one combination that also looks like perfectly valid symbol, that's 0x35, the ASCII symbol '5' you are seeing.

0101100101 is another one, that is 0x4D, the ASCII symbol 'M'.

0010101011 is another one, that is 0xAA, which is an unprintable ASCII character, the box you are seeing.

This is why there should never be a constant symbol transmission, at least occasionally an idle space that is longer than one symbol should be sent to make the receiving UART to synchronize properly on the actual start bit.

\$\endgroup\$
18
  • 2
    \$\begingroup\$ @mrbean how exactly do you tell the difference between a start/stop bit and data bits if you are constantly sending characters? Justme provides clear examples of why this is happening. You are confusing this with an intra-bit timing issue, which it is not \$\endgroup\$ – BeB00 Dec 30 '20 at 10:46
  • 1
    \$\begingroup\$ @mrbean you are not understanding the issue. What is a start pulse? How is it special and different from any other line state? The answer is that it's not, its just the first pulse. The problem comes when you cant actually tell what is the "first pulse", because the line is a constant stream of pulses. In that case, you have to rely on framing errors to tell you what is and isn't an actual start pulse, and in this case, thats not enough \$\endgroup\$ – BeB00 Dec 30 '20 at 10:52
  • 2
    \$\begingroup\$ @mrbean the point here is that there is no idle, so the receiver cant distinguish whats happening. It absolutely is jumping into the middle of a bitstream \$\endgroup\$ – BeB00 Dec 30 '20 at 11:00
  • 2
    \$\begingroup\$ @mrbean that's literally what the answer is saying. "This is why there should never be a constant symbol transmission, at least occasionally an idle space that is longer than one symbol should be sent to make the receiving UART to synchronize properly on the actual start bit." \$\endgroup\$ – BeB00 Dec 30 '20 at 11:04
  • 2
    \$\begingroup\$ @mrbean this has nothing to do with sampling at the middle of a bit period to synchronize to middle of a bit. It's about synchronizing to constant data stream when suddenly connecting wires during transmission, from which the receiver cannot know which bits are framing and which are data. \$\endgroup\$ – Justme Dec 30 '20 at 11:14
5
\$\begingroup\$

As an addition to Justmes answer (feel free to combine this into your answer):

This is a UART Transmission of an S: enter image description here

This is what happens if you dont have an idle:

enter image description here

And this part is what the receiver sees as a repeating 0xAA: enter image description here

edit: to be clear, i dont think this should be marked as the answer. This should just be an addendum to Justme's answer

\$\endgroup\$
3
  • \$\begingroup\$ +1 Nice helpful picture for the OP \$\endgroup\$ – mrbean Dec 30 '20 at 11:15
  • \$\begingroup\$ @BeB00 I Tried to add the delay but this doesn't work i am receiving the Box character again and i edited the code above. \$\endgroup\$ – Unpared Electron Dec 30 '20 at 12:01
  • \$\begingroup\$ @UnparedElectron the proper way to debug this is with an oscilloscope. I dont see your code in your question anymore \$\endgroup\$ – BeB00 Dec 30 '20 at 18:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.