I simply forgot to call the routine that was initializing the clock.
That's why any changes that I was making in the routine never reflected in action. So, when I placed a piece of code that was writing to the ICG register, the first thing in the main program - it worked.
But I did learn a lot about troubleshooting the clock.
Tip: If you need to verify the bus frequency of the system, just configure the clock output (it is PTC2 on the HCS08AW60) to output the sub-divided frequency of the bus.
SMCLK_MPE =1; // enable clock output
SMCLK_MCSEL = 0b111; // divide the bus frequency by 14
// (divided by the maximum to use with a slow oscilloscope,
// or a high bus clock)
PTCDS = 1; // high gain enable (for good oscilliscope reading)
PTCSE_TCSE2 = 1; // slew rate enable (makes a difference if using an internal/self clock)
Also,
See AN2494 Clock Usage Worksheet, very useful if you haven't seen it yet.
Another tip:
If using an external crystal/resonator try placing it as close as possible to the MCU. I overlooked this note in my previous project, and the clock could not start. I had to resolder it right next to the MCU. By "As close as possible" I mean on the same layer and side where the pads and pins comeout, about 0.2" from the pins will do. If it still doesn't start, lower the capasitor values from 22pf to 10pf.
Regards,
Andrey
Message Edited by Andrey on
2007-06-06 02:53 PMMessage Edited by Andrey on
2007-06-06 02:54 PMMessage Edited by Andrey on
2007-06-06 02:55 PM