You are right Peg,
What I meant is that the BUSCLK is actually one fourth of the oscillator clock (as you correctly pointed out).
Anyway, much of the information I wrote, I got from Jim Sibigtroth, one of the men behind the HC05, HC08 and HCS08 design.
I agree with you that, for us, the poor users, most of the CPU and the reasons for one or another feature are all inside a black box.
Again, regarding the CPUCLK of the HCS08 and the different domains of BUSCLK and CPUCLK pointed by Denn, I believe that the higher-rate CPUCLK is used to allow faster internal operations within the CPU. Here is a small paragraph I received from FS tech team:
"The much faster HCS08 bus made it impractical to keep pretending that reads and writes take the same amount of time and it also made the designers pay closer attention to the critical speed paths through the CPU. In some cases this meant using two bus cycles to do some CPU operations instead of one, but at the same time they were able to increase bus speed by significantly more than 2x without increasing the logic speed and power consumption as much as you would expect. In HCS08 the CPU can issue a new read on every bus cycle, but it cannot use the returned data in the next bus cycle like the HC08 could. At the start of a new instruction, there are two bytes of object code ready and waiting in the 2-stage instruction queue and a third byte on its way (the third read was already issued, but the data hasn’t been latched into the CPU yet)."
Unfortunatelly, I am not sure I am authorized to publish all the contents of the message.
Best regards,Bigmac,
I completely agree with you. Questions related to the internal timmings whitin the HCS08 CPU and possible internal bottlenecks are invisible to the programmer. From the programmer's point of view, the basic concept is that the BUSCLK rules all timming within the CPU. That is it.
An LDA #5 instruction, for example, takes 2 BUSCLK cycles to complete. Change the addressing mode and the number of clock cycles will increase accordingly.
The cycle-by-cycle detais presented in the CPU section of the HCS08 device datasheets can help understanding why some modes need more cycles than others.
The cycles for LDA #5 are pp (two program fetches). The first fetch reads the opcode from the memory, the next fecth reads the operand and load it into the accumulator. It is important to note that these two bytes belong to next instruction (following the LDA instruction), because the two bytes for the LDA instruction were already loaded into the instruction queue.
The LDA opr8a, for example, takes 3 BUSCLK cycles (one more than using the immediate addressing mode) and the cycles are rpp. Considering that the instruction opcode and the operand is already loaded into the instruction queue. The first execution cycle of the instruction reads the memory address pointed by the operand and stores it into the accumulator. The two next program fetches (pp) fill the instruction queue.
Looking the same instruction (LDA opr8a) on the HC08 CPU (using the AN2627) it is easy to notice that the cycles are different: prp. This happens because the HC08 has only a one-byte prefetch buffer. The first byte of the instruction (the opcode) is already loaded into the prefetch buffer when the instruction starts, the operand is then fetched (the first p cycle), then the memory is read and the value is stored into A (the r cycle) and then the prefetch buffer is filled with the opcode of the next instruction (the second p cycle).
I think that is the way it goes (maybe I am wrong).
Best regards,
Message Edited by fabio on
2008-03-04 01:31 PM