I have issue with developing UART comm from scratch. I don't use any libraries, as I am not big fan of them, so I go bare metal way.
Anyway, I don't know whether I am missing some config or not, but when I try to send string via UART, it got stuck after first char. Well, first char is not sent as well.
I went through the data sheet couple of times, and I just can't see what I am missing.
enable ASYNCAPB
set ASYNCAPBCLKCTRL to enable UART0,
disable reset via ASYNCPRESETCTRL,
set RX,TX pins
USART CFG, baud rate and enable uart.
And then just write to TXDAT. Everything seems to be OK from debugger point in MCUXPRESSO, but UART seems to get stuck on sending the char and next cycle STAT = b'10010' or RXRDY, TXIDLE.
Why doesn't it change to TXRDY I don't understand...
Attached is memory dump of UART.
Solved! Go to Solution.
I really hope NXP will sort their UM because as much as I like mcu's I hate when some things are not written in user manual or assumed to be known or whatnot...
Anyway, I was missing enabling the fractional divider in async clkctrl ... which I havent saw mentioned anywhere in UART basic configuration chapter...
LPC_ASYNC_SYSCON->ASYNCAPBCLKCTRLSET |= _BV(15);
Hope it will help someone who will be having a same mind boggling exercise.
I really hope NXP will sort their UM because as much as I like mcu's I hate when some things are not written in user manual or assumed to be known or whatnot...
Anyway, I was missing enabling the fractional divider in async clkctrl ... which I havent saw mentioned anywhere in UART basic configuration chapter...
LPC_ASYNC_SYSCON->ASYNCAPBCLKCTRLSET |= _BV(15);
Hope it will help someone who will be having a same mind boggling exercise.