Hi
I use UART on the K20 tower board but it should be about the same for the K40.
UART0 and UART1 use the core clock the other UART channels are using the bus clock. In my case the core clock is twice as fast as the bus clock.
The UART init function within the drivers (uart.c) is only turning on the clock, enables tx/rx and sets the clock divider bits srb and brfa. The only thing left to do is giving the Pins the right function (e.g. PORT_PCR_MUX(0x3)).
| /* Calculate baud settings */ |
| sbr = (uint16)((sysclk*1000)/(baud * 16)); | /* Determine if a fractional divider is needed to get closer to the baud rate */ | | brfa = (((sysclk*32000)/(baud * 16)) - (sbr * 32)); |
|
Maybe you are doing the sbr calculation wrong. brfa is not important when setting slow baudrates and its wrong anyway (overflow occures, what caused me some troubles by setting baudrate to 921'600).
If you do these settings you should see 10 bits with the KO (start,data,stop --> the lsb comes first)