I could use some IAR blinking code.
2006-05-22 by cacheman22
I am looking for some code to toggle a pin on the LPC-2119 using the
IAR KickStart compiler. P1.16 in particular. I have an LED hooked up
and am looking to make it blink. The trouble I'm having is not with C,
but setting up the project and environment. I have code downloading to
a ET_ARM STAMP LPC-2119 by ETT.
I have this code compiling:
/***************************************************************/
#include <IOLPC2119.H> // LPC2119 MPU Register
/* pototype section */
void delay_led(unsigned long int); // Delay Time Function
int main(void)
{
PINSEL2 &= 0xFFFFFFFC; // Makesure GPIO1.16 = GPIO
Function
IO1DIR = 0x00010000; // Set GPIO1.16 = Output
IO1SET = 0x00010000; // Set GPIO1.16 Output Pin
(OFF LED)
// Loop Blink LED on GPIO1.16 //
while(1) // Loop Continue
{
IO1CLR = 0x00010000; // Clear Output Pin P1.16 (ON
LED)
delay_led(1500000); // Display LED Delay
IO1SET = 0x00010000; // Set Output Pin P1.16
(OFF LED)
delay_led(1500000); // Display LED Delay
}
}
/******************************************************/
/* Delay Time Function */
/* 1-4294967296 */
/******************************************************/
void delay_led(unsigned long int count1)
{
while(count1 > 0) // Loop Decrease Counter
{
count1--;
}
}
Any help would be appreciated.