0

My FPGA Spartan 3E supports 50 Mhz clock via ocillators. Now I am using RS-232 cable connection to send output bits serially into my computer system using HyperTerminal/RealTerm.

However the baud rates the COM ports/RealTerm support are different. I am using a male to female connector cable.

How do I synchronize them both. I have tried including a FIFO inside my design with one end connected to my Design output (write) and read end connected to the RS-232 Transmitter at the Transmission speed clock, using a clock divider. But that doesn't make the synchronization happen as expected.

  • RS-232 is an *asynchronous* protocol, so you don't synchronize anything. The protocol is self-synchronizing. The only thing that you need is to generate the proper baud rate out of your 50MHz, which should be extremely easy since this frequency is *much* higher than any standard BR, so even an inexact frequency division should suffice. (I am assuming you have an UART implemented on your FPGA...) – Eugene Sh. Aug 04 '17 at 18:41
  • Yes I do have an UART implemented in the design. – Shankhadeep Mukerji Aug 04 '17 at 18:42
  • Is there any other way to generate proper baud rate from 50 MHz other than clock divider or FIFO? – Shankhadeep Mukerji Aug 04 '17 at 18:43
  • Are you looking for the hard way? – Eugene Sh. Aug 04 '17 at 18:45
  • I am loosing some bits in the transmission so would like to try any other way. – Shankhadeep Mukerji Aug 04 '17 at 18:45
  • What is your actual baud rate generated? How much does it deviate from the standard? – Eugene Sh. Aug 04 '17 at 18:46
  • I have generated baud rate of 115,228 bits/s using 50 MHz by a clock divider of 455. Standard baud rate is 115,200 bps. – Shankhadeep Mukerji Aug 04 '17 at 18:51
  • This really should not impose any problem as long as your UART is implemented properly. – Eugene Sh. Aug 04 '17 at 18:52
  • Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/63345/discussion-between-shankhadeep-mukerji-and-eugene-sh). – Shankhadeep Mukerji Aug 04 '17 at 19:00
  • 1
    Related question: [How do some microcontrollers implement baud rates even though it uses crystal frequency not scalable to standard baud rates?](https://electronics.stackexchange.com/questions/270518) – Simon Richter Aug 04 '17 at 19:15
  • The UART is designed to tolerate a reasonable frequency difference between the two participants. – user57037 Aug 05 '17 at 04:52

1 Answers1

1

There is a module named 'kcuart' from xilinx. This can be downloaded from their website and it's free. It has a ready code that you can instantiate in your design for desired baud rates.

samjay
  • 66
  • 5