cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
akleica
Explorer
Explorer
7,120 Views
Registered: ‎11-13-2007

How to define C_BAUDRATE on the UART Lite

I have a working project using the UART Lite and when I change C_BAUDRATE to some arbitrary value, the tools says it's "illegal."

How do I find out what are the acceptable values? Is it only the ones presented in EDK's dialog box for the UART? Where does it get those numbers?

 

115200

128000

230400

460800

921600

 

The top 3 don't match any of my windows rates? (I'd like to run faster than 128000)

 

 

6 Replies
akleica
Explorer
Explorer
7,119 Views
Registered: ‎11-13-2007

(The top three speeds)
0 Kudos
Chadn_na
Xilinx Employee
Xilinx Employee
7,113 Views
Registered: ‎08-15-2007

Here is an excerpt from the OPB Uartlite MPD file: 

PARAMETER C_BAUDRATE = 9600, DT = integer, DESC = Baudrate, PERMIT = BASE_USER, VALUES = (110= 110 , 300= 300 , 1200= 1200 , 2400= 2400 , 4800= 4800 , 9600= 9600 , 19200= 19200 , 38400= 38400 , 57600= 57600 , 115200= 115200 , 230400= 230400 , 460800= 460800 , 921600= 921600 )

 

Yes you are correct on the allowable baud rates. 

 

Note this file can be found at:

$XILINX_EDK\hw\XilinxProcessorIPLib\pcores\opb_uartlite_v1_00_b\data

0 Kudos
ronen_agranat
Visitor
Visitor
4,130 Views
Registered: ‎07-28-2010

I find this thread rather ambiguous, given that it has nearly 3000 views.

 

Is it possible to specify an arbitrary baud rate for the UART Lite IP? If so, may we please have an example of how this could be done, from the C/C++ source code?

 

It is very simple to specify an arbitrary baud rate on a small embedded microprocessor such a Freescale GT16. On the other hand, It is usually impossible on a PC, due to (over) optimisation of design.

 

MIDI operates at 31.15 [kbaud]; not a 'standard' value.

 

Thanks for the help!

Regards

phatline
Visitor
Visitor
1,027 Views
Registered: ‎08-21-2018

10 years later:

any solution for 31.15kbaud? (midi)

we are on Vivado Spartan 7 now... and midi is still the standard for music instrumetns (special digital synths)

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

I think you'll find midi is 31.25kbps, rather than 31.15k.   Midi was designed in the 1980s, and the idea was to use a simple (one TTL IC) divider from a "MHz" clock down to 500kHz, then use the UART in x16 mode to give a data rate of 31.25kbps.

I designed electronics in that decade, and that's exactly the sort of way designers would think back then (e.g. "let's change the baud rate to this so that we can save one chip and not need an additional crystal").

 

Today (or even 20 years ago) in an FPGA, one can use a fractional divider to synthesise any baud rate from nearly any clock.  If the IP doesn't support that, you are free to modify the IP, chose different IP, or write your own.

0 Kudos
vanmierlo
Mentor
Mentor
984 Views
Registered: ‎06-10-2008

To add a baudrate to the UART Lite you have to find its component.xml file and add it there.

 

E.g. <Vivado installation dir>/2018.1/data/ip/xilinx/axi_uartlite_v2_0/component.xml :

    <spirit:choice>
      <spirit:name>choice_list_44379a9c</spirit:name>
      <spirit:enumeration>110</spirit:enumeration>
      <spirit:enumeration>300</spirit:enumeration>
      <spirit:enumeration>1200</spirit:enumeration>
      <spirit:enumeration>2400</spirit:enumeration>
      <spirit:enumeration>4800</spirit:enumeration>
      <spirit:enumeration>9600</spirit:enumeration>
      <spirit:enumeration>19200</spirit:enumeration>
      <spirit:enumeration>38400</spirit:enumeration>
      <spirit:enumeration>57600</spirit:enumeration>
      <spirit:enumeration>115200</spirit:enumeration>
      <spirit:enumeration>128000</spirit:enumeration>
      <spirit:enumeration>230400</spirit:enumeration>
      <spirit:enumeration>460800</spirit:enumeration>
      <spirit:enumeration>921600</spirit:enumeration>
    </spirit:choice>

I don't think there is any further check on the baudrate, just this predefined selection list.

 

You may want to make a copy of the whole axi_uartlite_v2_0 directory and place it in your IP repo or project.

0 Kudos