How to configure EXTCLK for detecting the respective clock frequency

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Dear all,
Issue 1, PLL does not initialized by
Issue 2, EXTCLK associated registers can not be written
Issue 3, CLC SEL register can not be written
thank you.
TC234 V2.0 development board, the choice TC234L the TriCore chip, the compiler tool is Hightec

My code is as follows:



while (SCU_CCUCON0.B.LCK != 0U) /*Wait till ccucon0 lock is set */
{
}
SCU_CCUCON0.B.CLKSEL = 1; /*Select the EVR as fOSC for the clock distribution */
SCU_CCUCON0.B.UP = 1; /*Update the ccucon0 register */
SCU_EXTCON.B.SEL0 = 1;
SCU_EXTCON.B.DIV1 = 1;
SCU_EXTCON.B.EN0 = 1;

CCUCON1 = (CCUCON1 & (~(0x50000000))) | (0x50000000); //(~(0xf << 28))) | (0x101 << 28)
PLLCON0 = (PLLCON0 & (~(0xfe30))) | (0xfe30);
CCUCON2 = (PLLCON0 & (~(0xf << 30))) | (0x1 << 30);
CCUCON0 = (PLLCON0 & (~(0xf << 28))) | (0x1 << 28);
while (SCU_CCUCON0.B.LCK != 0U) /*Wait till ccucon0 lock is set */
{
}
0 Likes
1 Reply
TC101
Employee
Employee
Hello Jinhangliu,

most of the system configuration registers are EndInit protected, i.e. you have to disable the protection first and then you can write to the registers.
If you are getting a trap, then this is a strong evidence, that the protection is still active.

This protects the uC from SW bugs, which are messing up the important System configurations.
0 Likes