Hello,
i have one TWR-S12G128 board.
with processor expert, I set bus clock as 10M. but in debugger, when i use FLASH command to check the bus frequency, it shows 11M. should i trim the frequceny? if yes how to?
You can check the bus frequency value by measuring the signal on oscilloscope.
There is ECLK pin on S12(X) devices which can provide bus signal (on the S12G128, it is pin 25 (PB0) or connector J8 - pin1). To ensure that, put this code line into main function:
ECLKCTL_NECLK=0;
See ECLKCTL register description in the ref. manual.
If it is the same, i would rather recommend setting the bus freq manually. Here is attached the PLL calculator.
Execute the file and select S12P family (the CPMU module is the same as on S12G). Then select Oscillator = 8MHz and desired Bus Freq.
On the right side you'll see register settings.
The way how to initialize the System Clocks is described in the SW example project of the application note AN4455 MC9S12G128 Demonstration Lab Training:
http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4455.pdf
http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4455SW.zip
Regards,
Ivan