0

I have implemented a TDC and an 8-bit encoder in my Artix-7 FPGA board and I want to transfer this data from FPGA to PC via UART protocol! I don't know if I should save this data in FIFO memory or BRAM memory and then apply uart protocol or if block memory is already included in uart protocol?

I did some research and really didn't understand what to do. I'm not an FPGA expert.

I would appreciate your help if someone could guide me to a learning site or tutorial on how to save data to a memory and communicate it to a PC via the UART module.

Best regards

usereyi
  • 9
  • 2
  • "I don't know if block memory is included in uart protocol" is a category error. A protocol is a protocol and a block is a block. You can't plop down a protocol into your FPGA design, only a circuit block (often called IP: intellectual property). There are surely many blocks that implement the UART protocol and it's also simple enough that you can make your own (that might even be preferable) – user253751 May 03 '22 at 16:04
  • In order to gauge your level of understanding - how did you implement the TDC and "8-bit encoder"? – user253751 May 03 '22 at 16:05
  • Thank you for correcting me! so I will just need an IP from IP catalog in vivado to implement in it my design ? For the TDC, I just created a delay chain with a carry4 primitive and connected the output to the input of an FF. For the encoder, I used the priority encoder method to turn a 256 bit (thermometer code) into an 8 bit (binary code) – usereyi May 04 '22 at 07:38
  • The UART protocol is not complicated and you might be able to implement it yourself depending on your knowledge level. You literally just output 1 while nothing is happening, and when you want to send a byte, you output 0, then the bits, then 1. It's a parallel-to-serial converter. – user253751 May 04 '22 at 08:30
  • (I might have got that backwards; it might be 0 when idle, 1 before the bits and 0 after. I think it's 1 when idle though) – user253751 May 04 '22 at 13:06

1 Answers1

0

Sending with UART is very simple. It's a parallel to serial conversion.

Choose a pin to use for the UART signal.

When you have no data to send, output 1. When you have a data byte to send, output a 0, then the data (8 bits), then a 1. If you want to send more bytes, send each byte separately (with 10 in between).

Do this at a certain bit rate which has to be agreed on at both ends, e.g. 19200 bits per second. And that's all there is to sending UART.

You can do this in literally any way you want. If there's a parallel-in serial-out shift register block then you will probably find it useful. Otherwise, you could use a multiplexer to select the bit at each position, and a counter to keep track of which bit position is currently being sent.

Receiving is a little bit trickier because you have to synchronize the clock to the sender's clock. But you aren't even trying to receive in this project.

user253751
  • 11,998
  • 2
  • 21
  • 37