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({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!
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
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!
Where can I found information about what does automaticilly the USB multilink interface ?