Hi, I have a samll problem with my MCB2360. I'm pretty new to this, so my question should be very easy to answer.
All I wanted to do was to flash my LEDs on the Board. I read the User Manual from NXP, which got me this far:
#include <LPC23xx.H> int main() { //Setting Pin Select Block 4 to GPIO PINSEL4 = 0x00000000; PINSEL10 = 0; //initialize P2.0 till P2.7 as output FIO2DIR = 0x000000FF; // Set as output //clearing current LEDs FIO2CLR = 0x000000FF; //Mask all unneeded Pins FIO2MASK = 0xFFFFFFFF00; //Set all these Pins high. FIO2SET = 0x000000AA; while(1) { } return 0; }
As you can see all I try to do is to enable the LEDs (P2.0 - P2.7) in the order 10101010. But nothing happens. Please help me ;)
Hi, I was able to resolve the problem. It seems that somehow my Projekt was noct configured correctly. All I needed to do was creating a new projekt and load the files into it.
Thanks for your help!
btw, my code now looks like this:
#include <LPC23xx.h> void LED_Init(void) { PINSEL10 = 0; //Disable ETM FIO2DIR = 0x000000FF; //Define P2.0 ...P2.7 as Output FIO2MASK = 0x00000000; //Mask all pins as editalbe } void LED_Out(unsigned int value) { FIO2CLR = 0xFF; //clear all LEDs FIO2SET = (value); //lit selected LEDs } int main(void) { int a; LED_Init(); while(1){ LED_Out(0xAA); for(a = 0; a < 2000000; a ++); //wait about half a second LED_Out(0x55); for(a = 0; a < 2000000; a ++); //wait about half a second } }