cancel
Showing results for 
Search instead for 
Did you mean: 

Determining the CPU Clock at runtime

st10f
Associate II
Posted on May 16, 2007 at 17:43

Determining the CPU Clock at runtime

3 REPLIES 3
st10f
Associate II
Posted on May 15, 2007 at 17:58

Hi,

is there a way to determine the CPU Clock frequency at runtime?

It seems that the ST10 Flasher is doing something like this.

Joe Merten

najoua
Associate II
Posted on May 16, 2007 at 05:19

Hello JoeM,

The way the ST10Flasher works:

After entering BSL mode and the respective initialization, the ST10 scans the RxD0 line to receive a zero byte from the ST10Flasher, i.e. one start bit, eight ‘0’ data bits and one stop bit. From the duration of this zero byte, it calculates the corresponding baudrate factor with respect to the current CPU clock, initializes the serial interface ASC0 accordingly and switches pin TxD0 to output.

----------------------

The CPU Clock frequency is configured by hardware using P0H.7, P0H.6 and P0H.5 combinations. These bits are latched in register RP0H during reset.

The CPU Clock frequency is output on P3.15 pin.

P3.15 is CLKOUT System Clock Output (either prescaled or not through register XCLKOUTDIV).

For more details, please refer to the ST10F276 user's manual.

Best regards,

Najoua.

st10f
Associate II
Posted on May 16, 2007 at 17:43

Najoua,

> The CPU Clock frequency is configured by hardware using P0H.7, P0H.6 and

> P0H.5 combinations. These bits are latched in register RP0H during reset.

Can I read this P0H boot configuration at runtime?

Ok, I see that is was stored in RP0H.

Joe.

[ This message was edited by: JoeM on 18-05-2007 18:03 ]