It isn't the CPU timing you're measuring, it is most likely the SLOW GPIO peripheral timing.
This isn't documented anywhere. This is something you have to reverse-engineer after deciding on a chip.
I've just checked the MCF5307 manual, and it doesn't document the timing.
This has been addressed in newer chips. Read the "Rapid GPIO" chapter for a chip like the MCF51QE128. The intro says:
The Rapid GPIO (RGPIO) module provides a 16-bit general-purpose I/O module directly connected to the
processor’s high-speed 32-bit local platform bus. This connection to the processor’s high-speed platform
bus plus support for single-cycle, zero wait-state data transfers allows the RGPIO module to provide
improved pin performance when compared to more traditional GPIO modules located on the internal slave
peripheral bus.
That doesn't really say that the normal GPIOs are glacially slow, but the term "slave peripheral bus" usually means "all the peripherals are on a bus bridge controller that connects the fast CPU bus to the peripherals, which run on a MUCH slower clock.
Type "slow GPIO" into the Search Box at the upper right of this page. One post will tell you about the known "12 wait states on GPIO access on MCF52255". The worst I've come across was an ARM-core chip that threw 200 wait states on GPIO because the CPU ran at 400MHz and the GPIO ran a multi-state state machine running from 10MHz.
I've just found an excellent previous reference, giving reasons, timing and references, here:
Re: excution time
I would paste some excepts from there into here, but you can't paste any more than one line into this forum without it going crazy. I hope they fix that bug soon.
Here's some one-line excepts and previous measurements:
I've measure on an MCF5329:
So a write to a port register takes about 76ns or about 18 CPU clocks and a "port |= bit" read-modify-write takes about 33 clocks.
"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."
MCF523x quote:
"Platform peripherals (defined as FEC, UARTs, QSPI, I2C, and DTIMs) on the MCF523x run at the platform clock frequency, which is 1/2 the CPU clock frequency. AFAIK, these accesses incur no wait states.
Off-platform peripherals (defined as eTPU, FlexCAN(s), PITs, EPORT, GPIO, and crypto blocks) run at 1/2 the platform clock frequency, which is 1/4th the CPU clock frequency. As noted by others, accesses to the PORT registers require 3 clock cycles, a remnant of when we used to support port replacement units for emulation purposes."
If you want to measure CPU speed, program a timer to free-run and then read the counter before a series of instructions, then again after, and subtract the two. Make sure you also read the timer twice in a row and see how long reading the timer takes - it is likely to be as slow as writing to the GPIO is.
ARM and PPC chips have dedicated timers in the CPU that can be used for measuring CPU timing without these problems. ColdFire chips don't, so you have to rewrite the measurement code for each different chip and then "calibrate" it as well.
When you've taken your measurements of CPU speed and the GPIO Read and Write speed, post them back to this thread.
Tom