Yahoo Groups archive

Lpc2000

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

Message

Re: PINSEL2 crashes everything

2005-08-03 by soren_t_hansen

--- In lpc2000@yahoogroups.com, "Aalt Lokhorst" <lokhorst@s...> wrote:
> Hello Soren,
> 
> I think your hardware is running fine, probably the behaviour is not
what your expecting but that is not caused by a hardware failure.
> 
> Look in the User Manual of the LPC2132, you can find it on the
Philips site.
> 
> The manual tells:
> Warning: use read-modify-write operation when accessing PINSEL2
register. Accidental write of 0 to bit 2 and/or bit 3 results in loss of 
> debug and/or trace functionality! Changing of either bit 4 or bit 5
from 
> 1 to 0 may cause an incorrect code execution!
> 
> The same manual shows in Table 60 that the Reset value of bit 2
isn't 0, 
> the default value is the inverted level that is at P1.26 (RTCK)
during Reset. This P1.26 needs to be low during reset if you want to
use the JTAG port. This will result in setting bit 2 of PINSEL2. If
you clear this bit then it will disable the JTAG port.
> 
> Regarding your code:
> I think your line of code isn't doing what you want it to do.
> 
> PINSEL2 = (PINSEL2 & (0 << 2) & (0 << 3));
> 
> You are 'anding' PINSEL2 with 0 because the both (0 << #) items will
evalute to 0. If you want to clear a bit then you have to 'AND' with the 
> inverted bitvalue to prevent the changing of the other bits . (I
think it should be something like ~(1<<2)
> 


So this actually means that I can't use these pins at the same time as
the JTag interface? Seems that I need to have a little chat with the
guys who made the requirements for this assignment :o)

Thank you very much for the clarification

/Søren

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.