Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

Altera Avalon UART Speed Increase

Hi Everyone,

I am currently using a nios ii cyclone 1 epc120 development fpga for an embedded application. At present I have the Altera Avalon UART set to a baud rate of 115200 within the SOPC builder.

However, I need to increase this baud rate by at least a factor of 2. Does anyone know if this is possible using this FPGA? or do I need to upgrade to a different board?

Cheers.

4 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Yes, you can change the baud rate in SOPC builder. You can also make it adjustable by the embedded software.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks for the reply.

    I know you can adjust the baud rate in SOPC builder but when I open the drop down box 115200 is the highest speed. Is there another way to increase this?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    1 -If you configure the UART such as to have a run-time programmable baud rate, you can program a divisor into the divisor register after power-up. See this document:

    http://www.altera.com/literature/hb/nios2/n2cpu_nii51010.pdf

    There are two other options I can think of which would obviously be unsupported:

    2 - Edit the "class.ptf" file found at "C:\altera\90\ip\altera\sopc_builder_ip\altera_avalon_uart". Look for this description for the baud combo box:

    
                         COMBO baud
                         {
                            title = "Baud Rate (bps): ";
                            id="baud";
                            values="115200,57600,38400,31250,28800,19200,14400,9600,4800,2400,1200,300";
                            editable = "1";
                            DATA 
                            {
                               baud = "$";
                            }
                         }

    Then obviously modify the values line to add your desired baud rate in there. I can't promise this is going to work. You may also have to modify the accompanying "em_uart.pl" perl script. Just do a search on baud in that file and you'll see where to modify it.

    3 - The final option is to generate your SoPC system with the undesired baud rate. Then hand modify the generated HDL file to change the divisor. There should be a line somewhere like "assign divisor_constant = X" where you would calculate and replace X with the correct divisor rate.

    Have fun,

    Jake