AnsweredAssumed Answered

Changing UART baudrate while running

Question asked by sinstr on Feb 3, 2014
Latest reply on Feb 17, 2014 by Jithul_Janardhanan
Im looking for a good prosedure for changing the baudrate while running.
I've written a test code based on the UART echo back example, running on a ADSP-21489 EZ-board.
It works, but I don't think is very reliable. Seems to need the delays, I don't know why, It could be something else thats gets wrong without them.
This is pretty much the function I call when I'm chagning the baudrate after UART is initialized:
void UARTnewbaud
     int delay;
     while ((*pUART0LSR & UARTTHRE) == 0) //poll to ensure UART has completed transfer (might add a timeout here)
     for(delay=0; delay<1000; delay++) {asm("nop;");}  //add some delay
     *pUART0RXCTL = 0;     //Clears UART0 in receive mode - ADSP HW ref page 21-23
     *pUART0TXCTL = 0;     //Clears UART0 in core driven mode
     /*Set baudrate and mode*/
     *pUART0RXCTL = UARTEN;     //Resets UART0 in receive mode 
     *pUART0TXCTL = UARTEN;     //Resets UART0 in core driven mode
      for(delay=0; delay<1000; delay++) {asm("nop;");}  //add some delay

Appreciate any suggestion on how to do this properly or some shared experience about changing baudrate after initialization.
PS. I'm kind of a newbie, so please bear with me:)