Skip to main content Skip to local navigation

Getting started with the LPC802

This is a little different.  Apparently, the LPC802 board SDK / BSP is already installed in MCUXpresso, but you can't compile anything beyond the simple printf example.  Anything that requires the LPC8xx.h file won't compile.  So I reimported the SDK like I did for the KL25 and KL43.  That means that you see two versions of the board.  But at least I can compile stuff now.  Download it from here.

 

new project after fresh SDK install.

after importing the SDK from scratch (like with the KL25) I can now set up a standard project.

Documentation is pretty sparse... but oh... there seem to be a few good sites:

  1. https://ucexperiment.wordpress.com/2015/02/22/lpc810-breakout-board/
  2. https://microdig.wordpress.com/category/lpc800
  3. http://67.222.144.123/lpc800um/
  4. https://microdig.wordpress.com/category/lpc800/

So I got a basic LED blinking project up and running:

 

#include "LPC802.h"

#define LED_RING (17)
#define LED_EYES (7)
#define LED_UMOUTH (8)
#define LED_LMOUTH (9)
#define LED_SMOUTH (12)
#define LED_USER1 (8)
#define LED_USER2 (9)
#define LED_USER3 (12)


int main(void) {


// Turn on the clock to the GPIO Module
// reference: http://67.222.144.123/lpc800um/#RegisterMaps/gpio/c-Basicconfiguration.html
SYSCON->SYSAHBCLKCTRL0 |= (1UL<<SYSCON_SYSAHBCLKCTRL0_GPIO0_SHIFT);

// Configure the pin
// REference: http://67.222.144.123/lpc800um/#RegisterMaps/gpio/c-GPIOoutput.html

// Set data direction on GPIO to Output.
GPIO->DIRSET[0] |= ((1UL<<LED_USER1) | (1UL<<LED_USER2) | (1UL<<LED_USER3) | (1UL<<LED_RING) | (1UL<<LED_EYES));

// Change the LED values

GPIO->SET[0] = (1UL<<LED_USER1);
GPIO->SET[0] = (1UL<<LED_USER2);
GPIO->SET[0] = (1UL<<LED_USER3);
GPIO->SET[0] = (1UL<<LED_RING);
GPIO->SET[0] = (1UL<<LED_EYES);

GPIO->CLR[0] = (1UL<<LED_USER1);
GPIO->CLR[0] = (1UL<<LED_USER2);
GPIO->CLR[0] = (1UL<<LED_USER3);
GPIO->CLR[0] = (1UL<<LED_RING);
GPIO->CLR[0] = (1UL<<LED_EYES);

while (1) {

asm("nop");

} // end of while(1)

} // end of main