Here's a simple program, written for the LPC802 or LPC804 microcontroller, using MCUXpresso 11.0, the ISO C11 compiler and the latest LPC802 (OM40000) or LPC804 (OM400001) SDK from NXP.
I started a project using MCUXPresso and the SDK, then erased the contents of the main .c file it produced, replacing it with the following:
The code is as follows.
It has not been tested on actual hardware, just tested to compile. If you want to test on actual hardware I suggest putting a breakpoint inside the while loop somewhere.
/* barebones C11 project for the LPC804. * Tested to compile using MCUXpresso 11.0 and ISO C11 compiler selected. * Jan 13, 2020, James Andrew Smith * */ #include "LPC804.h" // replace the "804" with "802" if you're using the 802 chip. int main(void) { /* no special hardware startup */ /* just a variable. Written like this to make sure it doesn't get optimized out. */ volatile static int i = 0 ; /* Enter an infinite loop, just incrementing a counter. */ while(1) { i++ ; /* just an assembler call */ __asm volatile ("nop"); } return 0 ; }