LC60: External Crystal and Clock Monitor

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

LC60: External Crystal and Clock Monitor

1,516 Views
BasePointer
Contributor II
Hi,
 
My application works normally at fbus = 6.291456 MHz with FEE mode by using external 32.768kHz crystal.
 
I also setup and trim MCU for FEI mode to work at same bus frequency. I want to use FEI mode instead of SCM mode when any failure occurs on external 32.768 crystal while MCU in FEE mode. And if the fault on external crystal disappeared, I want to switch back to FEE mode.
 
In my application, clock monitor enabled and, I can detect loss of lock and loss of clock conditions.
 
Here is my questions:
- If I start with FEI mode, I can't switch MCU to FEE mode. I initialized mcu with "ICGC1 = 0b00101100;// FEI mode", then, MCU can't enter FEE mode with "ICGC1_CLKS=3;"
 
- In FEI mode, RTI interrupt loses its functionality?
 
- ICGS1_ERCS flag doesn't indicate external crystal status when MCU in FEI mode?
 
- I need events such as FEE mode is failed switch FEI and in FEI mode, FEE mode can be usable again, switch FEE.
 
- Why is ICG module so complex to understand? :smileysad:(
 
- Can I detect external crystal failures in stop3 mode?
 
10x,
BP.
Labels (1)
0 Kudos
2 Replies

300 Views
peg
Senior Contributor IV
Hi BasePointer,

Most S08's are similar in these regards.



BasePointer wrote:

- If I start with FEI mode, I can't switch MCU to FEE mode. I initialized mcu with "ICGC1 = 0b00101100;// FEI mode", then, MCU can't enter FEE mode with "ICGC1_CLKS=3;"
 


This is explained in the description of the CLKS bits of ICGC1, The xtals pins are reserved or not on the first write to these bits only.



BasePointer wrote:

- In FEI mode, RTI interrupt loses its functionality?
 


Well here they differ. There are two clock sources for the RTI, external clock or an internal 1kHz clock. With other devices eg GB/GT only the external clock can be used in run mode. However this device explicitly says that either can be used. In neither can you select the same internal clock as used by the ICG. Refer to 5.7 in the manual.


BasePointer wrote:

- ICGS1_ERCS flag doesn't indicate external crystal status when MCU in FEI mode?


It will only do this in FEI mode when CLKS is selected to 1:1 i.e while you are trying to change over to the external clock.


BasePointer wrote:

- Why is ICG module so complex to understand? :smileysad:(
 



I have no idea!


BasePointer wrote:
- Can I detect external crystal failures in stop3 mode?


No!






0 Kudos

300 Views
BasePointer
Contributor II
Hi peg,
 
Thanks for your short answers.
I set to FEE mode and immediately switched to FEI for reserving crystal pins at start-up.
 
BP.
0 Kudos