Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12603 Discussions

It is possible to run altera_avalon_uart at 921600 bps?

Altera_Forum
Honored Contributor II
1,433 Views

It is possible to run altera_avalon_uart at 921600 bps instead of 115200? 

QSys GUI have only 115200 but with some code there is possibility? 

 

Thanks
0 Kudos
6 Replies
Altera_Forum
Honored Contributor II
701 Views

The limitation comes from the baud ALLOWED_RANGE property in the _hw.tcl of that module, and I believe it is only restricting you when creating a component with fixed baud rate. 

There are many ways to work around it: don't use fixed baud rate, clone and modify the Altera supplied copy of the module, or don't do any of the above and just supply it with 8x the clock you told it you would give it.
0 Kudos
Altera_Forum
Honored Contributor II
701 Views

Tomorrow I will try.. 

Thanks
0 Kudos
Altera_Forum
Honored Contributor II
701 Views

 

--- Quote Start ---  

The limitation comes from the baud ALLOWED_RANGE property in the _hw.tcl of that module, and I believe it is only restricting you when creating a component with fixed baud rate. 

There are many ways to work around it: don't use fixed baud rate, clone and modify the Altera supplied copy of the module, or don't do any of the above and just supply it with 8x the clock you told it you would give it. 

--- Quote End ---  

 

This work around looks cool, it this still maintain the driver stability during transfer?
0 Kudos
Altera_Forum
Honored Contributor II
701 Views

Modifying 'altera_avalon_uart_hw.tcl' is a very clean way of doing it. However, this script does perform a number of checks on your chosen values and won't simply accept anything you throw at it. I've successfully added 250kbaud before. However, adding 921600 didn't work - the script's checks threw it out. This was (most likely to be) due to it not complying with a valid baudrate error the script allows. This is clearly dependent on your source clock frequency. You may find some settings that allow it to work. However, you may have to modify the script further so that the checks allow it to use your chosen baudrate and source clock frequency. 

 

If it were me, I'd be coding my own, custom UART. 

 

Cheers, 

Alex
0 Kudos
Altera_Forum
Honored Contributor II
701 Views

Yes I have my custom UART but not with avalon interface and I have no time to add and test all.. 

Anyway 250k is better... thank you
0 Kudos
Altera_Forum
Honored Contributor II
701 Views

For what it's worth, 921600 with a 25MHz or 50MHz clkin commonly used on the eval boards has zero error and no warning from the script.  

 

Should you care for an even more odd-ball baud rate, the only thing you should need to have to do is e.g. use a PLL to supply a clkin as an integral multiple of the baud rate.
0 Kudos
Reply