Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

RE: [lpc2000] Re: I could use some IAR blinking code.

2006-05-22 by Andrew Berney

Hi,

Kind of right... but Pinsel2 should be: &= 0xFFFFFFF3;

bits 0..1 are reserved with reset value 0x0 (obviously And them with 1 to
preserve)
bit 2 is 0 for GPIO for P1.16-31 and 1 to turn on Debug Port
bit 3 is 0 for GPIO for P1.16-31 and 1 to turn on Trace

table 63 in the manual for pinsel2.

Andy

-----Original Message-----
From: lpc2000@yahoogroups.com [mailto:lpc2000@yahoogroups.com]On Behalf
Of pfavr2
Sent: 22 May 2006 14:31
To: lpc2000@yahoogroups.com
Subject: [lpc2000] Re: I could use some IAR blinking code.


Hmm it might be my advice is no good, as I was looking in the LPC2148
manual. Sorry.

Peter

--- In lpc2000@yahoogroups.com, "pfavr2" <pfavr2@...> wrote:
>
> 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.
> >
>








Yahoo! Groups Links

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.