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
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: