TRIM for 9S08SH8 using OSBDM

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

TRIM for 9S08SH8 using OSBDM

4,218 Views
RogerSchaefer
Contributor III

I purchased an OSBDM from Witztronics mostly to program a MC9S08SH8. There were a couple of "little details" that I was not aware of before I made my purchase.

One was the need to hold the BKGD low on power up for new chips. But ONLY for new chips. This is discussed in other threads.

The other detail was that the OSBDM does not have the trim feature that P&E has. That means you can’t use the OSBDM to program 9S08xx chips if you intend to use the internal oscillator and also features that require an accurate clock like the SCI. As almost all of my programs make use of the SCI, this is a big problem.

In another thread some App notes were recommended but they mostly give general information rather than answers to this problem. The closest to being useful is AN2496 but the software is for chips that use ICG however the 9S08QG8 and 9S08SH8 use the ICS clock system. They are considerably different. I may be able to rewrite the AN2496 software for the ICS but it would take a lot of time and effort.

So what to do? Buy a $100 programmer from P&E to program a $2 chip? Spend a lot of hours of my time writing software to make something that I have already purchased work? Or just give up on the 9S08 family? Maybe the latter. I miss the days of Motorola.

Main reason for this rant: has anyone solved the problem of trimming the 9S08QG8 and 9S08SH8 when using the OSBDM? I don’t want to reinvent the wheel.

Roger

Tags (2)
0 Kudos
Reply
3 Replies

1,232 Views
Z_C_Wang
NXP Employee
NXP Employee
I have the same issue when I use E-value8 for (R)S08 (another low cost debuger similar to OSBDM). My sulution is: Open the Debugger, Menu>HCS08 Open Source BDM>Show Status, some infomations are shown In the small window. "System Clock   8.98MHz" shows the curent clock frequency. I input trim value manually in to Trim register (for QG/QD, address is $003A, reset value is $80). Type "reset" in Command window then enter. Open the status window again, "System Clock" should be changed now. By trying different values, I can find out the right trim value. So the last thing is to write this value to the source code to save it to Flash. 
The trim value varies for different chips. For development, we usualy just reprogram one chip time and time, so we don't need to modify trim value in souce code oftenl. Ofcause, this way is not sutable for volume production. 
(bigger trim value = lower ICS clock)
0 Kudos
Reply

1,232 Views
UcTechnoGeek
Contributor II

When the MCU is tested at the factory, the trim value is programmed into the Flash.

To use this trim value, you should include copying from the byte at 0xffaf to ICSTRIM in your source code.

To use this with the programmers based on the Opensource BDM:

Set the Hiwave debugger so it does not automatically erase and load the code on startup of the debugger.
From the HCS08 Open source BDM menu, select the Flash menu.
In the Flash dialog box that comes up, use the "Load" button to load your code.
This should program the target device without performing an auto mass-erase.

UcTechnoGeek

0 Kudos
Reply

1,232 Views
CamiloA_
Contributor III
I'm in the same situation develops OSBDM the truth and I am not useless because if the system does not support the basics of a system that is embedded the clock does not work. if someone knows something to fix this I would appreciate.
Thanks.
0 Kudos
Reply