Where can I find trim location address in MKE04Z128?

cancel
Showing results for 
Search instead for 
Did you mean: 

Where can I find trim location address in MKE04Z128?

884 Views
robertogiovinet
Contributor III

Hello everybody

I've a problem with MKE04Z128. I would like to use 48MHz CPU core frequency, but I've notice that is not possible during Debug Mode, because of the problem that the trim value is not loaded into ICS_C3, as describled in the datasheet. So i would like to load via SW the value but I don't know the address where it is located, and in the documentation is not mentioned.

Does anybody know the address of this trim location?

Thank you for you support

Roberto

0 Kudos
3 Replies

153 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Giovinetti,

I am using FRDM-KE04Z, the MCU on this evaluation board is MKE04Z8VFK4.

From the datasheet MKE04P80M48SF0 we can find the factory trimmed frequency of Internal reference clock is 37.5kHz.

IRC factory trimmed.jpg

From the reference manual MKE04P80M48SF0RM we can find: All MCU devices are factory programmed with a trim value in a reserved memory location. This value is uploaded to the ICS_C3 register and ICS_C4[SCFTRIM] during any reset initialization.

And I can get this value during debug mode. I am using KDS3.2 with Processor Expert.

ICS_C3 FRDM-KE04Z.jpg

If you are using the project in FRDM-KEXX Driver Library Package (REV 1.2.1), pay attention to the wrong ICS_TRIM_VALUE. You need comment the #define TRIM_IRC in ke04_config.h when using the default 37.5kHz IRC.

comment TRIM_IRC.jpg

The PTC5(PTH2 of MKE04Z128) on FRDM-KE04Z can be used to output Bus Clock through enable the CLKOE in register SIM_SOPT0.

So that you can observe the frequency of bus clock through the oscilloscope.

Best Regards,

Robin

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

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

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

0 Kudos

153 Views
robertogiovinet
Contributor III

Hi Robin

Thank you very much for the time you spent for your answer. Unfortunately it doesn't answer to my question, because in the reference manual MKE04P80M48SF0RM , you can find thatScreenshot_2016-04-06-10-41-12.jpg

I discovered the problem because I used PTH2 to monitor the bus clock frequency. I use CodeWarrior 10.6 with PEMicro Multilink Universal. I noticed that the Multilink Universal wrote the trim value and if I run my software not in Debug Mode everything is ok. I searched for the location where Multilink write the values, but there's no address.

Immagine.jpg

As you can see Multilink write 0x53 to TRIM location (not mentioned).

I stolen the 0x53 value and manually I put it into ICS_C3 and it works fine, but is not the correct way to solve the problem. I would like to generalize so if I change board I don't have problem and I don't have to search for the value.

Best Regards

Roberto

0 Kudos

153 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Giovinetti,

This problem has been fixed in KDS3.2.0 and CW10.6.4, you can have a try. (I am using FRDM-KE04Z board)

If you don't want update your CodeWarrior10.6, you need trim IRC to 37.5kHz.

Please refer the method in "Yes, OSDA can trim the reference of internal clock source!"

Best Regards,

Robin

0 Kudos