RE: introduce Delay in MPC565 !!

"Dobbin Allan-r11834" <[email protected]> Wed, 16 Aug 2006 07:33:56 -0700
Newsgroups gmane.comp.hardware.motorola.microcontrollers
Message-ID <4147ED8B92A864498825C07E53594E4A0166A369@az33exm20.fsl.freescale.net>
The best resolution you could possibly hope for is the sysclk i.e. if
you run at, say, 40MHz, the best you could get is 25ns.  Using the TB,
this is reduced further to the TMBCLK period as controlled by SCCR and
is typically sysclk divided by a further 16.
 
So although I'm not providing the answer (because I don't really know),
the real question is which counter module can be clocked with the
smallest prescaler i.e. another core register, MIOS counter, etc.
 
A comment on your function below - there will be an overhead of a couple
of dozen instructions multipled by the memory access rate (approx a few
micro-secs) which you could subtract from 'microsecs' to get a more
accurate delay, obviously taking care not to go below 0.    
 
- Allan

 
 

________________________________

From: [email protected] [mailto:[email protected]] On Behalf
Of praveen
Sent: Wednesday, August 16, 2006 6:31 AM
To: [email protected]
Subject: [MPC500] introduce Delay in MPC565 !!



Hi all,
I am working with MPC565. and i have made a routine which can introduce
delay in microseconds.

Dummy Routine to Introduce Delay in MicroSeconds :
----------------------------------------------------------
micro_second_delay( int microsecs )
{
int time_base_start = get_tb_time();

//Keep wait until the parameter 
while( ( get_tb_time() - time_base_start ) < microsecs ); 
}

get_tb_time ( void )
{
mftb r3,TB 
}
----------------------------------------------------------
Is it possible to have a function which can introduce delay in
nanoseconds ?
i know that ,TB register is 64-bit incrementing counter. 
how will i be able to manage to get specific delay ? Can i make generic
funtions ?


Thanks in advance 

Praven 





---------------------------------
How low will we go? Check out Yahoo! Messenger's low PC-to-Phone call
rates.

[Non-text portions of this message have been removed]



 


[Non-text portions of this message have been removed]



-----------------------------------------------------------
To learn more about Freescale Microcontrollers, please visit
http://www.freescale.com/mcu


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/MPC500/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/