Hello All:
I recently purchased a Keil MBCSTR9 demo/eval board which sports the ST STR912FW44 ARM9 processor. Cool board! Cool chip! Like Keil intended, I started off by loading the BLINKY project and studying it. It worked a treat but now I'm ready to start playing with the UART, Timers, and CAN. And for those things, you need to understand how the system clock(s) work.
I THINK I've got it figured out but I wanted to see if anyone else agrees....
It appears that the clocks are configured at startup by the STR91x.s assembler startup code. Based on examination of this file and pages 52 thru 58 of the STR91x Reference manual (UM0216), it appears that the Keil MBCSTR9 board will start up running at 48 Mhz even though it is equipped with a 25 Mhz crystal. Here's my logic:
Line 330 in the assembler code is as follows:
SCU_CLKCNTR_Val EQU 0x00030000
So, only bits 16 and 17 are "on". That said:
1) fBCLK=HCLK/2 (default)
2.) FMICLK=RCLK/2 (not the default)
3.) fMSTR=fPLL (not the default)
The important part being that fMSTR=fPLL....so we are set up at the mux to use fPLL as our clock source...yes?
Now if I understand the SCU_PLLCONF correctly, when BC019h is written to the register (as it is in the STR91x.s startup file), then the PLL is turned on and the frequency is given by
(2*N*fOSC)/(M*2^P) ....where "^" means exponentiation as in "2 to the power of P"
=(2*C0h*25Mhz)/(19h*2^3).....pardon the use of mixed number systems...
=(2*192*25Mhz)/(25*8) ......getting to the final answer
=48 Mhz
So, if I understand it correctly, my MBCSTR9 board is running at 48Mhz when I run the BLINKY example as supplied by Keil?. If I wanted to change frequency or clock source, should I do it in my STR91x.s startup file, or should I (can I) do it in C after the board is "up and running"?
Sorry for the long-winded post, but I am trying to exhaust every possibility of figuring this stuff out myself by Please read the manual. But, sometimes you need to bounce an idea of someone else.
Thanks in Advance,
-=Rich=-