Yahoo Groups archive

Lpc2000

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

Message

Re: I could use some IAR blinking code.

2006-05-23 by pfavr2

Hi,

I just learned that the example code below shouldn't be put into flash
- if you still want to use the JTAG that is ;-)

The JTAG shares the GPIO1 port, so setting everything in IODIR1 will
disable JTAG. This means that after flashing I cannot use the JTAG
anymore :-(

The line:

   IODIR1= 1<<24;          // Set GPIO1.24 = Output

Should (probably) have been:

   IODIR1|= 1<<24;         // Set GPIO1.24 = Output

If anyone has a good idea on how I recover my board (i.e. JTAG) I
would be very grateful. Mabye it can be done without any hardware
changes or the Philips ISP (as I don't have one)?

Best regards,

Peter

--- In lpc2000@yahoogroups.com, "pfavr2" <pfavr2@...> wrote:
>
> Hi,
> 
> Thanks Andy it works now on my Olicom LPC2148. Here is my code for
> reference:
> 
> #include "LPC214x.h"
> 
> volatile unsigned int j=1000000;
> 
> int main(void)
> {
>   unsigned int i;
> 
>   PINSEL2&= 0xfffffff3;   // Make sure GPIO1.24 = GPIO Function
>   IODIR1= 1<<24;          // Set GPIO1.24 = Output
>   j=5000000;
>   while(1) {
>     IOCLR1 = 1<<24;
>     for(i=0;i<j;i++);
>     IOSET1 = 1<<24;
>     for(i=0;i<j;i++);
>   }
> }
> 
> 
> --- In lpc2000@yahoogroups.com, "Andrew Berney" <amb@> wrote:
> > 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
>

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.