External Clock in Processor Expert

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

External Clock in Processor Expert

Jump to solution
4,076 Views
Alexandre_Mello
Contributor II
I'm using the CodeWarrior 3.1 with the MC9S08GB60. I wanto to configure the processor expert to use an external clock.

My question is: How do I do so that when the MCU start, it uses the internal clock, until the external clock can be configured, and after that switch to the external clock?
Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
1,859 Views
ProcessorExpert
Senior Contributor III
Hello,
I am sorry, but the current version doesn't support to have the low-speed mode clock higher that the high-speed mode.
There is only one option remaining - use the "User code before PE initialization" item from the cpu bean "Build options". This item enables to put a user defined code on the beggining of the EntryPoint function, before the cpu is switched to the external clock. However, because this code is executed before an initilization of the stack you cannot use method calls and you cannot use any bean to do SPI communication. The initialization of the external clock source has to be hand coded.

Petr Hradsky
Processor Expert Support Team
UNIS

View solution in original post

0 Kudos
Reply
5 Replies
1,859 Views
alex_spotw
Contributor III
Hi:

Processor Expert does that for you automatically. Check the internal function _EntryPoint() in Cpu.c, and this will show the code that PE uses to wait until the External Clock is ready, before switching from the internal clock.

Regards,

Alex
0 Kudos
Reply
1,859 Views
Alexandre_Mello
Contributor II
Well, but I still have a Problem. The problem is that the MCU have to initiate the external clock using the SPI, and so the MCU have to initiate with the internal clock, and then switch to the external. How could I do that?
0 Kudos
Reply
1,859 Views
ProcessorExpert
Senior Contributor III

It is possible to use "User code before PE initialization" item at Build Options page in CPU Inspector. The second way is to use speed modes, to set internal clock as high speed and low mode as external clock.

Best Regards, Jan Pospisilik, Processor Expert Support

0 Kudos
Reply
1,859 Views
Alexandre_Mello
Contributor II
I tried to use the speed modes, but CodeWarrior doesn't let me because the low speed mode is faster than the high speed. What can I do?
0 Kudos
Reply
1,860 Views
ProcessorExpert
Senior Contributor III
Hello,
I am sorry, but the current version doesn't support to have the low-speed mode clock higher that the high-speed mode.
There is only one option remaining - use the "User code before PE initialization" item from the cpu bean "Build options". This item enables to put a user defined code on the beggining of the EntryPoint function, before the cpu is switched to the external clock. However, because this code is executed before an initilization of the stack you cannot use method calls and you cannot use any bean to do SPI communication. The initialization of the external clock source has to be hand coded.

Petr Hradsky
Processor Expert Support Team
UNIS
0 Kudos
Reply