We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi there Keil forums, I have a question about how my LPC 1114 responds to data over a Uart connection.
This is my UART interrupt code:
/* UART Data Received Interrupt */ void UART_IRQHandler(void) { static NetworkLayerState networkState = Network_Idle; unsigned int interruptId = LPC_UART->IIR; while((interruptId & 1) == 0) { switch((interruptId >> 1) & 0x07) { case 0x02: //Receive Data Available case 0x06: //Character time-out indicator (buffer flush) networkState = NetworkStateMachine(LPC_UART->RBR & 0xFF, networkState); break; case 0x03: //Receive Line Status interrupt break; //Not handling frame errors } interruptId = LPC_UART->IIR; } }
My computer and mcu are connected via a usb to uart cable. I want to know what kind of data I need to send to my mcu in order to trigger this interrupt. For example if I want to send the integer "1" to my mcu how would I do that and then I can store that integer value in a variable within the firmware of the MCU. My GUI is done in C# and it is what I use to communicate with the mcu.
en.wikipedia.org/.../transmitter
And, of course, be sure to study the UART section in your chip's Datasheet (or "user manual" or whatever the manufacturer calls it).