C for embedded controllers

Dan J. Declerck declrckd at cig.mot.com
Tue Nov 28 23:52:32 GMT 1995


> --------

>    In message <199511281504.KAA13699 at po_box.cig.mot.com> , you write:

> | > The 16 and 18 clock cycle times (for two-clock reads and writes) still
> | > look correct to me. How is it (CPU32 right?) not going to "re-fetch" 
> | > the "move"?
> | 
> | Because it's "LOOP mode" and doesn't induce a change in flow.

> Oh... yea... nice. 20% faster... Clearly the better choice.
> Something to remember for small loops. So, Dan, what other tricks
> do you have? :)

Let's say you have a piece of code in which you have a wait, but the wait is 
not enough to require a real-time OS call. (The pre-charge time of a Z8530
UART comes to mind) You can combine LOOP mode with a ROXL (16 bit instruction only)
to wait X clocks without fetching instructions, thus using less power.

Also, you can use shifts with loop mode to find the first one or zero in a 
word or long. 

Generally, using loop mode in all of the strcpy(), memcpy(), etc... helps a lot
in the long run.

I wrote a ton of macros to access TPU control regs and made the code read-able.

-Dan



-- 
=> Dan DeClerck                        | EMAIL: declrckd at cig.mot.com      <=
=> Motorola Cellular CSD               |                                  <=
=>"The truth to CDMA... is spreading"  | Phone: (708) 632-4596            <=
----------------------------------------------------------------------------



More information about the Diy_efi mailing list