Hi,
I'm currently trying to the same thing (i.e. making a LED blink on
port 1.24 of an LPC2148). I'm using GNU tools and openocd. So far I
haven't succeeded.
Looking at your source code, I believe that you need to assign all
zeros to PINSEL2 register. Writing ones means turning on Debug or
Trace according to the User Manual page 80.
Good luck!
Best regards,
Peter
--- In lpc2000@yahoogroups.com, "cacheman22" <cacheman22@...> wrote:
>
> 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.
>Message
Re: I could use some IAR blinking code.
2006-05-22 by pfavr2
Attachments
- No local attachments were found for this message.