I've always used the default internal reference frequency trim values when using the ICS (31,250Hz) and ICG (243,000Hz) on HSC08 processors. However I have a need to trim the ICS on a SH8 to a specific value (38,000) so that I can generate some accurate high frequency baud rates on the SCI.
The SH8 spec sheet says I can trim from 31,250 to 39,062.5Hz, so my value of 38,000 Hz is within range, to generate a bus clock of 19,450,000 and a baud rate of 64,000 with an SCI modulo divisor of 19.
I am using a P&E USB Multilink Interface. P&E tell me that I can use the Multilink to generate customised TRIM values by using the PROGHCS08 software and specifying a specific bus frequency, however I have not been able to work out how to do this. Has anyone done this?
thanks for your help in advance
David
Hello David,
I had a similar problem some time ago, where I required a custom trim frequency, in conjunction with using P&E PROGHCS08 software for programming (as opposed to using CW). The technical support that I received from P&E revealed that earlier versions of the software (which applied to me) did not directly support custom trim frequencies, but that it was possible to manually alter the .S08P algorithm file to provide the required trimmed bus frequency.
Open up the algorithm file applicable to the SH8 device within a text editor, and I would expect that you would have the following line at about line 10:
09BIT_TRIM=004A/004B/01/FFAF/FFAE/001E8480/
The hexadecimal value 001E8480 is the one of interest. When converted to a decimal number and multiplied by 8, this represents the bus frequency in Hz - 16 MHz in this case.
For a bus frequency of 19.456 MHz, the trim value would need to be altered to 00251C00 hexadecimal.
Regards,
Mac
Hi Mac,
Thanks for the reply. I will test this during the week.
This solution of course assumes BDIV=1 and RDIV=1, which they will in most cases.
I was always curious why they specify a maximum 20MHz bus frequency but the software demos only supported 16MHz with a 31.250kHz internal oscillator value.
I also want to achieve the same outcome with an S08AC128 processor, but I noticed they don't have the 09BIT_TRIM parameter in the configuration file.
Thanks again.
David
Hello David,
The trim value within the programming algorithm can be alternatively viewed as 64 times the reference frequency - this is probably a less ambiguous way of specifying the value.
For the 'AC128 device, this uses an ICG module, rather than the ICS module. I notice that the following line appears in the programming algorithm file -
HCS08_TRIM=004E/FFBE/00076A70/
Working backwards, the hexadecimal value 00076A70 is 486000 decimal. Since the nominal internal reference frequency is 243 kHz, it would seem that the number represents twice the required reference frequency in Hz. Something else for you to try.
Regards,
Mac