Author Topic: CPU clock speed vs bus clock speed  (Read 1139 times)

0 Members and 1 Guest are viewing this topic.

Offline CirclotronTopic starter

  • Super Contributor
  • ***
  • Posts: 3339
  • Country: au
CPU clock speed vs bus clock speed
« on: March 27, 2019, 10:38:19 pm »
In AN2717 it makes the following statement:

Quote
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.

A HC08 with an 8MHz xtal runs at a bus speed of 2MHz. What do they mean when they say "CPU clock is equal to the bus clock"?
 

Offline sokoloff

  • Super Contributor
  • ***
  • Posts: 1799
  • Country: us
Re: CPU clock speed vs bus clock speed
« Reply #1 on: March 27, 2019, 11:05:39 pm »
Read the Clocks section immediately prior to the section you quote.

Quote
This section describes the differences between the system clocks on M68HC08 and HCS08 MCUs.
Section 6.1, “Internal Clock Generator (ICG),” compares the ICG modules of the two MCU families.
Div2 vs. Div4
On M68HC08 MCUs, the output of the primary clock source (whether it is an external crystal, PLL, internal oscillator, etc.) is divided by four to create the system bus clock. To obtain an 8-MHz bus clock, the oscillator must run at 32 MHz.
On the HCS08 MCUs, the clock source is divided by two instead of four. So to obtain the same 8-MHz bus, only a 16-MHz oscillator is required.

The CPU clock is not the same as the CPU clock source (via the division described above). When they say the CPU clock is equal to the bus clock, they mean that both run at the same speed. Neither is locked to the clock source.
 
The following users thanked this post: Circlotron

Offline CirclotronTopic starter

  • Super Contributor
  • ***
  • Posts: 3339
  • Country: au
Re: CPU clock speed vs bus clock speed
« Reply #2 on: March 27, 2019, 11:46:40 pm »
Okay... so if we have an 8MHz xtal -
HC08 is 2MHz bus and 2MHz CPU
HCS08 is 4MHz bus and 8MHz CPU?

Further, if a particular instruction takes 5 bus cycles does that mean it actually takes 10 CPU cycles? If so, what is the purpose of talking about CPU cycles?
« Last Edit: March 27, 2019, 11:53:00 pm by Circlotron »
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1926
  • Country: au
Re: CPU clock speed vs bus clock speed
« Reply #3 on: March 28, 2019, 12:51:20 am »
Okay... so if we have an 8MHz xtal -
HC08 is 2MHz bus and 2MHz CPU
HCS08 is 4MHz bus and 8MHz CPU?

Further, if a particular instruction takes 5 bus cycles does that mean it actually takes 10 CPU cycles? If so, what is the purpose of talking about CPU cycles?

Marketing guys love bigger numbers ;)

The best way to compare core speeds it to look at the opcode rates, and derive say  XXns for a NOP (Usually the fastest opcode on most MCUs)
Higher MHz internally (divided down) does not help code speed, and does hinder crystal selection as MCU Xtal amplifiers able to oscillate above 32MHz are rare, and impose tight rules on Xtal selection.
 
There is one plus side to higher internal MHz, and that is that PWM timing can be made finer.

Some MCUs have Multipliers or PLLs to keep the Xtal MHz sane, but allow more MHz on the timers for better granularity.

An extreme example of this in a 8-bit MCU, can be seen in a Sanken MD6602, where they use a 12.5MHz Xtal, a 50MHz CPU clock, and a PLL x80 to give 1GHz on PWM !
Even with those numbers, Flash access times still bite, and a fetch of 32 bits is MAX of 25MHz.
That makes in-line code faster than branches, which have to reload a new flash line.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf