07-17-2018 06:42 AM
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
07-18-2018 12:17 AM
> 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.)
07-17-2018 06:44 AM
Is the baud rate right? Have you tried reversing the bit order?
07-17-2018 07:28 AM
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
07-18-2018 12:17 AM
> 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.)
07-18-2018 12:29 AM
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.)
07-18-2018 02:39 AM
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.