code warrior clocking PLL

Started by Dr Stewart Prince October 12, 2005
I have a question about the timing inside of Codewarrior: Does CW
emulate the PLL and the timing signals generated by it? In other works,
If I have a 1Mhz crystal used to generate the E and X clk frequencies,
then later on in I start the PLL at a different frequency, does CW
automatically change the clocking frequencies to account for the PLL?

Stewart Prince
Mech Eng
CSUN

>
>




Hello Stewart.

Yes, the CodeWarrior Full Chip Simulator for HC(S)12 is featured with a
real true time base. The "current" elapsed time is calculated by making the
report of executed cycles other the current bus frequency, adding
previously elapsed time (cumulated for previous frequencies). Actually you
can type "TRUETIME" in the Command window to get the true elapsed time in
microseconds.

Typically, the reference frequency is the oscillator frequency, and the
debugger handles internally a "clock factor" to derive the bus frequency
from the oscillator frequency.

This factor is "0.5" by default (a float value), i.e. when you select
"HCS12 CORE".
If you select "HCS12 SAMPLE" as derivative or any specific exact derivative
like "MC9S12DP256B", the CRG registers are simulated, including SYNR and
REFDV. And the factor is calculated according to SYNR and REFDV as in
specifications.
The PLL synchronization is also simulated including the setup time. When
the new bus speed is active, the previous elapsed true time is backuped and
the new true time is calculate as described here above with adding the
previously elapsed time backuped.

If you click in the debugger status bar item with the frequency in MHz, the
"Clock Frequency Setup" dialog should pop up. You can choose to display the
true time but I am sure you already found this. The clock factor is
displayed there. If you change the bus speed via PLL, you should also see
the bus frequency change in the statusbar and the dialog, and the clock
factor changes also in the dialog.

Note that, even if the cycles/truetime/frequency displays in the statusbar
are refreshed only every half second, the debugger handles PLL changes in
real time while running the simulation.

Regards,
Gilles
At 06:37 PM 10/12/2005, you wrote:
>I have a question about the timing inside of Codewarrior: Does CW
>emulate the PLL and the timing signals generated by it? In other works,
>If I have a 1Mhz crystal used to generate the E and X clk frequencies,
>then later on in I start the PLL at a different frequency, does CW
>automatically change the clocking frequencies to account for the PLL?
>
>Stewart Prince
>Mech Eng
>CSUN
>
> >
> >Yahoo! Groups Links