You don“t need to do that way using IOCLR and IOSET. Try the following:
for(;;)
{
IO1SET = (1 << 25); // This set pin P1.25 only, and leaves other pins unchanged
IO1CLR = (1 << 25); // This clear pin P1.25 only, and leaves other pins unchanged
}
If you are using the new lpc 2000 series ( such lpc214x, lpc213x or lpc2103 ), you can test using FIOSETx and FIOCLR. Check the chapter "General Purpose Input/Output ports (GPIO)" in the respective user manual.
Good luck!
German
ocnek1 wrotte:
> Hello,
>
> I wrote this little test to see how fast I could toggle an IO pin.
> Using the way I did it here from rising edge to falling edge the time
> is only ~540nS. This seems slow to me. Is it? I have verified that
> the DesiredSpeed is indeed locked at ~60MHz
>
> Thanks,
> Oc.
>
>
> int main( void)
> {
> IO1DIR |= (1 << 25);
>
> (void)SetNativeSpeed(14746uL);
> (void)SetDesiredSpeed(60000uL);
>
> (void)SetMAM( 3u, MAM_full_enable);
> (void)VPBControl(VPB_DIV1);
>
>
>
> for(;;)
> {
> IO1CLR &= ~(1 << 25);
> IO1SET |= (1 << 25);
>
> IO1CLR |= (1 << 25);
> IO1SET &= ~(1 << 25);
> }
>
>
> }
>
>
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
[Non-text portions of this message have been removed]Message
Re: [lpc2000] IO-PIN TOGGLE TEST Not very fast?
2006-05-12 by German Ortiz
Attachments
- No local attachments were found for this message.