Is it possible for me to send a C file over a UART connection to an LPC1114 mcu? The C file has configurations for the mcu, if it is possible how can I do so using C# in Visual Studio.
No.
--Cpt. Vince Foster 2nd Cannon Place Fort Marcy Park, VA
Is it possible to send C text that can trigger functions within the firmware?
Your post implies that you expect to have the target MCU (the LPC1114) implement code from a .c file sent over the UART.
This won't happen.
If, on the otherhand, the code within the MCU expects to have operating parameters sent through the UART, then it is possible to do that.
This relies on the firmware already in the target MCU to accept this data (not executable ".C" code) and act on that information.
Since you said 'send C text/file' it is clear that you don't know enough about embedded software, and therefore I answered 'No.'
What you need to do is modify the LPC1114 MCU firmware to accept serial parameters over the UART. The new software in the LPC1114 could then interpret the data to implement the 'triggering of functions.' Which means that you would need to be able to write embedded software.
So in the mcu itself I have written code that does expect to be triggered by incoming data, however I'm new to sending data over a serial port. So far I have only been able to send strings and it has not provoked any reaction within the mcu.
That is a good thing. I'm glad you are able to write/modify code with the LPC1114.
There are too many forum contributors that have zero clue on how embedded systems work.
Can you provide a code snippet that represents the data being sent, and how your firmware is processing it?
So heres the interrupt on the firmware side
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; } }
And now I want to send for example
WriteRegisterOpt(8, 1, 0x03249249, 0);
WriteRegisterOpt is a function within the mcu that I have coded.
I am still fairly new when it comes to how exactly the mcu and computer interact so I'm confused as to how I can take data I send and then code firmware to utilize it.
View all questions in Keil forum