|
I thought this should be easy, but I got stuck again
the external clock is 1.8432MHz and I have the following code:
UART_CLOCK_Start();
switch (BaudRate) {
case BR_9600:
UART_CLOCK_SetDividerValue(11);
break;
case BR_19200:
UART_CLOCK_SetDividerValue(5);
break;
case BR_38400:
UART_CLOCK_SetDividerValue(2);
break;
case BR_57600:
UART_CLOCK_SetDividerValue(1);
break;
case BR_115200:
break;
}
work great with 115200, but as soon as I change to any other baud rate, for example 57600, then my UART ISR will be triggered twice if I press keyboard once. For example, I type "U", (0x55), and my ISR pick up 0xB8 the first time, then 0x0 the second time.
I tried replacing CLOCK_SetDividerValue() with Clock_SetDivider(), does not make any difference.
|