MCG states

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

MCG states

962 Views
galadragos
Contributor III

Hi!

In am trying to go through the whole MCG state machine and use all the clocking options. Unfortunately the MCG is acting up, and refuses to change to FBE.

Anybody has code that actually works?

I don't want the "use Processor Expert" solution.

Thanks.

5 Replies

695 Views
galadragos
Contributor III

I think is a silicon problem.

My application runs through the whole MCG state machine continuously. I have found the only way to prevent a lock is no to change C1[IREFS] and C1[CLKS] at the same time !

When the MCU just started you can change the whole 3 bits in one command, but after it passed through a few states the MCG locks.

Safest way I could find was to ignore FEI-FBE, FEE-FBI, FBE-FEI, FBI-FEE, FBI-FBE, FBE-FBI changes, so the MCG will never go through those states.

The above sample code is not much help, as it assumes some premises which I do not have. It is also poorly documented, with fixed valued instead of bitmasks, making it very hard to read and understand.

0 Kudos

695 Views
galadragos
Contributor III

Just out of curiosity, does Freescale have some form of a spreadsheet with all the differences between parts in the same family ?

0 Kudos

695 Views
galadragos
Contributor III

KL25Z128

Isn't MCG the same in all MCUs ?

I have notice that the FLL source reference will not change, no matter what I set C1[IREFS] bit to the status bit S[IREFST] maintains the old value

0 Kudos

695 Views
adriancano
NXP Employee
NXP Employee

Hi,

The MCG are just similar between devices but some of the are not the same, here I show you a comparison between the MCG module of the KL25 and the MCG module of the KL05.

MCG comparison.png

In the Freescale's webpage you can find the sample source code package for the KL25. Go to this path: <install folder>\kl25_sc_rev10\klxx-sc-baremetal\src\drivers\mcg there you can find the mcg driver which include the complete set of functions to move between the MCG modes. If you do not want the complete source code package I attach to the MCG driver.

KL25 sample source code:

http://www.freescale.com/files/32bit/software/KL25_SC.exe?WT_TYPE=Lab%20and%20Test%20Software&WT_VEN...

I hope this information can help you.

Regards,

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. It would be nice!

-----------------------------------------------------------------------------------------------------------------------

695 Views
santiago_lopez
NXP Employee
NXP Employee

HI!

Can you tell us which MCU are you using?

Saludos

Santiago Lopez

0 Kudos