Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Altera_Forum
Honored Contributor I
806 Views

It is possible to run altera_avalon_uart at 921600 bps?

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 I
74 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.
Altera_Forum
Honored Contributor I
74 Views

Tomorrow I will try.. 

Thanks
Altera_Forum
Honored Contributor I
74 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?
Altera_Forum
Honored Contributor I
74 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
Altera_Forum
Honored Contributor I
74 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
Altera_Forum
Honored Contributor I
74 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.
Reply