Question about MC9S08EL32 ICS Trim

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

Question about MC9S08EL32 ICS Trim

518 Views
JalenZ
Contributor I

Hi, all:

    In the datasheet of MC9S08EL32, charpter 8.4.5 said: " All MCU devices are factory programmed with a trim value in a reserved memory location. This value can be copied to the ICSTRM register during reset initialization. The factory trim value does not include the FTRIM bit. For finer precision, the user can trim the internal oscillator in the application and set the FTRIM bit accordingly".

  My question: I read the reserved memory location 0xFFAF and 0xFFAE, the ruturn value is 0xFF, is this the trim value?

  I tested the busclk using  code: for(:smileywink:{PTBD6=0;PTBD6=1;}, what I get is 17.784Mhz!!! But my system's busclk setting is 16MHz, seems this chip is not trimed.

 

 Thanks!

Labels (1)
0 Kudos
3 Replies

303 Views
bigmac
Specialist III

Hello,

 

A value of 0xFF within flash corresponds to an unprogrammed value.  The original contents of locations 0xFFAE and 0xFFAF have likely been erased by a mass erase operation prior to programming.  The internal reference clock will need to be re-calibrated during programming  If you are using Code Warrior in conjunction with USB Multilink interface, this is usually done automatically.

 

Does your code write the value at address 0xFFAE into ICSTRM register?  This needs to be done once you have the proper calibration values stored in flash.  If you had written 0xFF into ICSTRM, I would have expected a bus frequency that was too low.

 

The POR value in ICSTRM is 0x80, and maybe this is the current setting.  An uncalibrated bus frequency that is about 11 percent too high would be within the unit-to-unit production tolerance.

 

Regards,

Mac

 

0 Kudos

303 Views
JalenZ
Contributor I

Thanks, bigMac!

I use CW conjunction with open source BDM. The factory trim value was erased by the BDM before download the object code. 

Now I read the factory trim value before doing a mass erase, and then write the value back. My initial code  write the value at address 0xFFAE into ICSTRM register, but when I using the SCI module, the communication is not work well, seems the bus frequency is not pricise enough. Is that means I need calibrate again?

Thanks! 

0 Kudos

303 Views
Brax02
Contributor III
Spoiler
If you are using Code Warrior in conjunction with USB Multilink interface, this is usually done automatically

 

Where can I found information about what does automaticilly the USB multilink interface ?

 

 

0 Kudos