lpcware

Trying to understand UART example, need help

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by zmogedra on Tue Jan 29 09:25:26 MST 2013
Hi I'm totally new to LPC 1100. Now I am trying to understand UART  example and make a simple program to receive command from UART to turn  on the LED on the board. In the example UART echo is handle like in this  sequence:

1. UART appropriate pins are turned on.
2. UART clock is enabled.
3. Stop and parity bits are set.
4. UART appropriate dividers are written for desired baud rate.
5. FIFO is enabled.
6. UART interrupts are turned on.

And then everything goes through interrupt handler.

My  first question is do you really need interrupt handler if you want to  read RX?? Can you just check in a while loop for UART_LSR first bit goes  to 1 which means data is ready for read in RBR.

Other question  is if you configure UART_IER  when what is the difference between  IIR_RDA flag Receive Data Available ant LSR_RDR flag Receive Data Ready? 


Man... LPC UART is much harder then atmel avr..;]
Thank you for your answers.

Outcomes