AutoTrim

cancel
Showing results for 
Search instead for 
Did you mean: 

AutoTrim

214 Views
smathad
Contributor II

Hi all,

Can anybody please give me some more input on what exactly is AUTOTRIM and what are its functions. 

We are working on a project to switch external crystal clock to internal 48M IRC on the Kinetis K24. 

I see that an AUTOTRIM configuration has been done during bsp initialisations. I want to know if this will affect our project in anyway and the precaution/changes that we need to take with this particular subject. 

Thanks!

Labels (1)
3 Replies

89 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello Sachin Mathad

 

Along with clock multiplier and dividers, clock trimming offers a way for users to control the frequency of internal clocks in their target processors. Unlike multipliers and dividers, digital clock trimming allows changes to the internal clock through specific registers.

 

The MCG Auto Trim (ATM) is a MCG feature that when enabled, it configures the MCG

hardware to automatically trim the MCG Internal Reference Clocks using an external

clock as a reference.

 

You can find more detailed information at chapter 25.4.7 "MCG Auto TRIM (ATM)" of the Reference manual.

 

Let me know if this is helpful, if you have more questions do not hesitate to ask me.

Best regards,

Omar

89 Views
smathad
Contributor II

Hello nxf54944

Thank you for your response.

I did go through the document, I want to know the implication if I do not do the autotrim?

I also looked into the registers to configure the autotrim - MCG_ATCVH and MCG_ATCVL, is there some upper and lower limit to configure these registers? 

An example in both cases would be very helpful. 

Regards,

Sachin

0 Kudos

89 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello Sachin Mathad

The implication of not use the Auto Trim is that you will not be able to change an internal clock frequency.

 

The ATCVL and ATCVH register is a 16bits register, the max value that can be stored is 65,535.

The limit is taking in count that the maximum external clock value is 32Mhz.

 

This formula can be useful to calculate the register value.

 pastedImage_1.png

Note that if you want to modify the INT48Mhz you need to multiply for 128 the value obtained from the above formula.

Let me know if this helps.

Best regards,

Omar

0 Kudos