Forum Discussion

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

set UART speed

How could I set write UART speed?

I'm opening /dev/uart1 device via fopen().

SOPC builder just do not have speed option.

I'm using Nios IDE 9 and Quartus 9 and Nios II dev kit EP2S60 RoHS.

Soemthing via IOCTL?

1 Reply

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

    You have two possibilities to set the baudrate in UART.

    Either at system generation time and you cannot modify it after, or in SOPC Builder you check "Baud rate can be changed by software (Divisor register is writable)". And you can modify the baudrate in software by writing into the divisor register.

    The formula between this register and the baudrate is in Quartus Handbook Volume 5 page 6-4 (http://www.altera.com/literature/hb/nios2/n2cpu_nii51010.pdf).