Friday, July 28, 2006

Is VIC there?

Fueled by my new confidence in debugging interrupt routines I started hacking the timer interrupt example. The user manual for the LPC214x family seems to have everything I could possibly want to know about the VIC and how to connect interrupts to pins. However, finding all the relevant bits has been quite a challenge. I also had a look at this which gave me some additional clues but again wasn't exactly a cut-and-paste job.
I started out by writing a little main that just had a heartbeat waggling a pin. (That way I would know if the LPC had run off into the weeds as the result of broken interrupt code.)
BTW: The masters of my daytime universe tell me I can publish code snippets like the below without all the copyright stuff, hence the "..."; an exercise left to the reader. ;-)


...
int main (void) {
IODIR0 = 0x00000000; // GPIO Port 0 is input (default)
IODIR1 = 0x00000001; // GPIO P0.1 defined as Output
while (1) { // endless heartbeat loop
IOSET1 = 1;
wait();
IOCLR1 = 1;
wait();
}
...

0 Comments:

Post a Comment

<< Home