Yahoo Groups archive

Lpc2000

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

Thread

Setting/Clearing IO Pins

Setting/Clearing IO Pins

2004-01-22 by Bill Knight

I vaguely remember a discussion on the list a while back about having
to use IOSET & IOCLR to output a value to pins on the LPC.  The
problem was there was a finite time between the two instructions.

In setting up a blinky lights program on an eval board I came across a
note in the LPC manual that may be of help. It pertains to the IOPIN
register.

"Note: for test purposes, writing to this register stores the value in
the output register, bypassing the need to use both the IOSET and
IOCLR registers. This feature is of little or no use in an application
because it is not possible to write to individual bytes in this
register."

I tried the following and it works.

for (;;)
  {
  delay(HALF_SEC);
  IOPIN ^= LED2_BIT;
  }

Regards
-Bill Knight
R O SoftWare

PS - I've done some more work with the include files I uploaded
yesterday.  Found and corrected a few errors and have added some
functionality.  This time I think I'll wait a bit to see if anything
else breaks before posting the changes.  If anyone needs an updated
file, please contact me.

Re: [lpc2100] Setting/Clearing IO Pins

2004-01-22 by Robert Adsett

At 02:32 PM 1/22/04 -0600, you wrote:
>for (;;)
>   {
>   delay(HALF_SEC);
>   IOPIN ^= LED2_BIT;
>   }

Ahh, but the question is how fast can it do it?

My original measurements are at 
http://groups.yahoo.com/group/lpc2100/message/37
I've since turned on optimization and the differnce between ASM & C has 
vanished.

I did see the IOPIN note, but ran out of time to continue measuring (plus 
Philips is clearly against the idea).

Robert

" 'Freedom' has no meaning of itself.  There are always restrictions,
be they legal, genetic, or physical.  If you don't believe me, try to
chew a radio signal. "

                         Kelvin Throop, III

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.