cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
mildredhayes
Adventurer
Adventurer
1,408 Views
Registered: ‎04-21-2018

UART receiver bug

Jump to solution

Hello, I am trying to implement a simple UART transmitter  I try to send a 8 bit word from the FPGA to the TeraTerm terminal using the following protocol 1 start bit 8 data bits 1 stop bit 115200 baud rate.

I grabbed the transmit module from the NANDLAND website https://www.nandland.com/vhdl/modules/module-uart-serial-port-rs232.html

It works in simulation but when i try it on the hardware a receive an ASCII symbol that doesn't correspond to the 8 bit that i send.

8 bit sent 00110001 = ( 1 in ASCII) and i see the paragraph sign symbol instead of 1.

I only connected the FPGA to the TX pin but left the RTS/CTS pins unconnected could that be the problem. (In that case how should i configure these pins)

I am using a VC707 fpga board.

 

Thank you

0 Kudos
Reply
1 Solution

Accepted Solutions
allanherriman
Mentor
Mentor
1,530 Views
Registered: ‎01-08-2012

> 8 bit sent 00110001 = ( 1 in ASCII) and i see the paragraph sign symbol instead of 1.

 

UARTs send the LSB first.  ASCII "1" should have produced the eight bit pattern 10001100.

 

The entire sequence should look like (with time increasing left to right):

 

...1111111111110100011001111111111.....
...idle        |<-data->|  idle ...
               |        |
             start     stop
bit bit

 

The other thing that often goes wrong is that, if you are trying to implement RS232 or similar, the '0' level is a positive voltage (a.k.a. Space), and the '1' level is a negative voltage (a.k.a Mark).

The UART core will be putting out '0' and '1' at whatever voltage that corresponds to on your IO Bank, but the RS232 drivers need to be inverting to achieve the correct voltages.

N.B. that won't apply if you have a "TTL" level connection, which is likely if you are using a USB<->Serial chip on your board.  '1' is '1' and '0' is '0' in that case.

 

The other other thing that often goes wrong is your baud rate.  Measure the pulse width with a 'scope to check that.  (It's probably easier to try all possible settings in TeraTerm though.)

View solution in original post

5 Replies
u4223374
Advisor
Advisor
1,406 Views
Registered: ‎04-26-2015

Is the baud rate right? Have you tried reversing the bit order?

0 Kudos
Reply
mildredhayes
Adventurer
Adventurer
1,392 Views
Registered: ‎04-21-2018

Yes, i have checked the baud rate on the Terminal and as well in my transmitter module.

I have also tried to reverse the bit order.

But i see the same problem

0 Kudos
Reply
allanherriman
Mentor
Mentor
1,531 Views
Registered: ‎01-08-2012

> 8 bit sent 00110001 = ( 1 in ASCII) and i see the paragraph sign symbol instead of 1.

 

UARTs send the LSB first.  ASCII "1" should have produced the eight bit pattern 10001100.

 

The entire sequence should look like (with time increasing left to right):

 

...1111111111110100011001111111111.....
...idle        |<-data->|  idle ...
               |        |
             start     stop
bit bit

 

The other thing that often goes wrong is that, if you are trying to implement RS232 or similar, the '0' level is a positive voltage (a.k.a. Space), and the '1' level is a negative voltage (a.k.a Mark).

The UART core will be putting out '0' and '1' at whatever voltage that corresponds to on your IO Bank, but the RS232 drivers need to be inverting to achieve the correct voltages.

N.B. that won't apply if you have a "TTL" level connection, which is likely if you are using a USB<->Serial chip on your board.  '1' is '1' and '0' is '0' in that case.

 

The other other thing that often goes wrong is your baud rate.  Measure the pulse width with a 'scope to check that.  (It's probably easier to try all possible settings in TeraTerm though.)

View solution in original post

allanherriman
Mentor
Mentor
1,342 Views
Registered: ‎01-08-2012

BTW, the "paragraph symbol" (pilcrow) is possibly encoded as (hex) F4.

This means that TeraTerm is seeing the bit pattern ...10001011111... on the line.  (I've included the surrounding start and stop bits.)

0 Kudos
Reply
mildredhayes
Adventurer
Adventurer
1,333 Views
Registered: ‎04-21-2018

Thanks , in fact the pulse width for every bit was wrong on the logic analyzer, while it was correct on my simulation test bench.

I have corrected it and now i see the correct ascii symbol on the TeraTerm terminal.

0 Kudos
Reply