Autonomous Clock Trimming Register Details needed for MC9S12ZVC micro

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

Autonomous Clock Trimming Register Details needed for MC9S12ZVC micro

664 Views
anwarhusengokav
Contributor II

Hi Radek,

 

I would like to configure the Autonomous Periodical Interrupt to wakeup the MCU every 10sec. Could you please provide me the details about the significance of the Autonomous Clock Trimming Register? PFA the attached details from the reference manual. 

For your information, I have configured as follows:

CPMUACLKTR = (CPMUACLKTR_ACLKTR1_MASK|CPMUACLKTR_ACLKTR2_MASK|CPMUACLKTR_ACLKTR4_MASK);

Clock source for API is ACLK

CPMUAPIRH = 0xD7u;
CPMUAPIRL = 0x40u;

I observe a drift of around 200ms. And it is varying board to board. What could be the reason?

 

173553_173553.PNGAutonomous Clock Trimming Register.PNG

Thanks in advance. 

 

Wish you a wonderful Happy New year 2017.

 

With Best Regards,

Anwar

Labels (1)
Tags (1)
0 Kudos
1 Reply

423 Views
RadekS
NXP Employee
NXP Employee

Hi Anwar,

The ACLK is a signal from internal RC oscillator.

The frequency of ACLK varying MCU to MCU. Therefore, every MCU should be trimmed for achieving the target +/-6% deviation from 20kHz (specified only for trimmed ACLK signal).

Since you modified CPMUACLKTR value and set the same value for all MCUs, you effectively disable factory trimming of ACLK signal and result API timeout will vary between boards per their ACLK signals.

 

I would like to recommend use factory trimming (do not modify CPMUACLKTR register value). The trimming value from the factory is automatically loaded from flash IFR field to CPMUACLKTR register during reset sequence. The exception may be only first engineering MCU samples which do not have full trimming yet.

 

If you are not satisfied with factory trimming (e.g. when you need 22kHz), you may do your own trimming and modify CPMUACLKTR register value after every reset. However, this trimming must be made at every single MCU separately.

I hope it helps you.

Have a great day,
Radek

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos