Yahoo Groups archive

Lpc2000

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

Thread

IO-PIN TOGGLE TEST Not very fast?

IO-PIN TOGGLE TEST Not very fast?

2006-05-12 by ocnek1

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);	
 }


}

Re: [lpc2000] IO-PIN TOGGLE TEST Not very fast?

2006-05-12 by German Ortiz

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]

Re: [lpc2000] IO-PIN TOGGLE TEST Not very fast?

2006-05-12 by Andy

I done a similar test, getting 1.282MHz switching speed (780ns period) which 
is roughly 390ns to match your test.  Strange how our result differ but your 
right it is very slow.

Andy.


----- Original Message ----- 
Show quoted textHide quoted text
From: "ocnek1" <markoskyj@...>
To: <lpc2000@yahoogroups.com>
Sent: Friday, May 12, 2006 5:51 PM
Subject: [lpc2000] IO-PIN TOGGLE TEST Not very fast?


> 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
>
>
>
>
>
>
>
>

Re: [lpc2000] IO-PIN TOGGLE TEST Not very fast?

2006-05-12 by David Hawkins

> 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

http://www.ovro.caltech.edu/~dwh/ucos/project_AR1803.pdf

Take a look at p29, it shows how to get 3.5MHz.

The test uses the older peripheral bus I/O registers. Some
newer devices have a set of faster registers.

Dave

Re: IO-PIN TOGGLE TEST Not very fast?

2006-05-12 by ocnek1

Wow German!!

Notes: Using WinARM + NewLib-LPC
       Olimex LPC-MT-2138 dev board
       Crystal @ 14.7456MHz
       -S option for size on optimization

What a difference.  On my dev board (LPC-MT-2138 from Olimex) the
rising edge to falling edge time is now down to 120nS though it is not
a 50% duty cycle.  Total period is about (rising to rising edge) 590nS
on my system.


Wow.




--- In lpc2000@yahoogroups.com, German Ortiz <elyop@...> wrote:
>
> 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.
Show quoted textHide quoted text
> 
> 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]
>

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.