excution time

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

excution time

2,180 Views
mkhademism
Contributor I


hi
I writed this code on MCF5485:
//interuupt disabled
while(1)
{
        MCF_GPIO_PODR_FBCS=0x00;
        asm( nop);
        MCF_GPIO_PODR_FBCS=0xFF;
}


and then I connected one of MCF_GPIO_PODR_FBCS pin to the Osil. I measured the period of  signal.It was
about 4 microsecond.
I think it is wrong because my microprocessor is working on 200MHz.
the execution time of "NOP" instruction in my program is about 200 nano second when this instruction exution time is 6 clock cycle.(about 30 nanosecond)
I think it is unormal.
what is your idea?
Labels (1)
0 Kudos
2 Replies

1,011 Views
SimonMarsden_de
Contributor II
Hi

A couple of suggestions:

(1) Make sure that you have all compiler optimisations turned on. Without optimisations, some compilers generate truly dreadful code.

(2) Make sure that the code is running out of the on-chip SRAM, or that you have the instruction cache enabled. Otherwise you will be slowed down a lot by the time it takes to fetch the opcodes from external memory on each loop.


Try these, and let us know how you get on.


Cheers


Simon
0 Kudos

1,012 Views
mjbcswitzerland
Specialist V
Hi

There has been a recent discussion on the Coldfire Wildrice mail list where this point was addressed and Freescale's John Bodnar gave some useful clarifications. I am assuming that this is also pertinent to your device.

Original question:
"Do you have any influence over the GPIO modules?  On the MCF5234, setting output pins high and low is painfully slow (despite the "set pin" and "clear pin" registers).  The latency as the write goes over to a slower internal bus with multiple wait states (even at the lower speed), is just too high.  I was trying to test and debug an interrupt routine using the traditional method of setting a pin high on entry and low on exit - driving the pins high and low took more time than the interrupt routine itself."
The complete mail exchanges can be found at http://www.wildrice.com/ColdFire/ [2.5.2008]. Since these are public I don't think there is any problem with me reproducing the main details here.

"This is a limitation of the platform architecture used on the MCF528x, MCF523x, MCF521x, MCF522xx, and MCF5270/1/4/5. The PORTS module resides on the other side of a bus bridge that runs at half the platform clock rate.  That means that for a 150 MHz MCF5234, the PORTS block is running in a 37.5 MHz clock domain, and that doesn't help.

The MCF5207/8, MCF532x, MCF537x, and MCF5445x are better in this respect.  The PORTS module resides in the platform clock domain, meaning that it gets clocked at 83.33, 80, 80, or 133 MHz, respectively, on these devices.  I/O toggles times, based on our benchmarks, are about 4 times as fast as on those devices listed in the previous paragraph."

Regards

Mark

www.uTasker.com



0 Kudos