First LPC2148 ARM7 microcontroller test – led blink

This is simple led blinking routine using my development board. The compiler I used was WINARM. I like this compiler because its free and adaptation is easy while the same functionality is in WINAVR. This simple test just blinks pin 16 of port 0. This I used when I first got to know ARM microcontroller. Here is the main code: /************************************************* * WinARM Demo P0.16 blink **************************************************/ #include “types.h” #include “LPC214x.h” #include “config.h” #include “armVIC.h” #define IOPINS016 16 static void lowInit(void) { // set PLL multiplier & divisor. // values computed from config PLLCFG = PLLCFG_MSEL | PLLCFG_PSEL; // enable PLL PLLCON = PLLCON_PLLE; PLLFEED = 0xAA; // Make it happen. These two updates PLLFEED = 0x55; // MUST occur in sequence. // setup the parallel port pin IO0CLR = (1< IO0SET &= ~(1< IO0DIR =(1< // wait for PLL lock while (!(PLLSTAT & PLLSTAT_LOCK)) continue; // enable & connect PLL PLLCON = PLLCON_PLLE | PLLCON_PLLC; PLLFEED = 0xAA; // Make it happen. These two updates PLLFEED = 0x55; // MUST occur in sequence. // setup & enable the MAM MAMTIM = MAMTIM_CYCLES; MAMCR = MAMCR_FULL; // set the peripheral bus speed // value computed from config.h VPBDIV = VPBDIV_VALUE;…

Continue reading