ARM NXP LPC 812 (SysTick) IRQ Blnk

TLA

SysTick IRQ Blink Program:

//----------------------------------------------------------------------------
// Name:    Blink.c
// Purpose: LED Flasher
//----------------------------------------------------------------------------
#include <stdint.h>
#include "LPC812.h" //my bare metal version

#define SYSTEM_CORE_CLOCK 12000000UL //12MHz

//our systick interrupt handler
void SysTick_Handler(void) {
  //toggle led pin
  GPIO_NOT = (1<<9);
}

int main(void) {
  //init peripherals
  SystemInit();
  //init gpio port
  GpioInit();
  //make gpio #9 pin an output (physical pin #10)
  GPIO_DIR |= (1<<9);
  //set systick clock interrupt @1ms
  SysTickConfig(SYSTEM_CORE_CLOCK);
  while(1);
}
Advertisements

About Jim Eli

µC experimenter
This entry was posted in Uncategorized and tagged , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s