From the application note "M68HC08 to HCS08 Transition - AN2717", it stated that:
" The M68HC08 CPU clock is equal to the bus clock. The HCS08 CPU clock is twice the speed of the bus
clock. A typical HCS08 has a maximum bus speed of 20 MHz and a maximum CPU speed of 40 MHz.
The documented cycle times for the CPU instructions are still referenced to bus cycles."
Now I from the datasheet of the HCS08 (SH8), there is a term called the BUSCLK:
BUSCLK — The frequency of the bus is always half of ICSOUT.
Then I program the ICS to use the FEI mode, and by default, the FLL should output 1024 x 31.25kHz to 39.0625kHz = 32 MHz to 40 MHz for the ICSOUT,
so by default, the BUSCLK should be 16 to 20 MHz. This looks fine and match with the previous statement in the application note. But then, when I write
the following program and measure PORTA bit 0 with a scope, I only got 680 kHz output. 680 x 13 = about 8 MHz. So this obviously does not match with
what is stated in the application note. The listed instruction cycle time listed in the assembly instruction table seems to be twice that of the BUSCLK.
|asm (" BSET 0,0x00000000 ");||// 5 cycles.|
|asm (" BCLR 0,0x00000000 ");||// 5 cycles.|
|asm (" BRA *-4 ");||// 3 cycles.|
Please tell me how all these "clock cycles" are related, as it seems very confusing.