In my first 9S12 design, I haven't paid enough attention to the PLL loop filter since I knew I was not going to use the PLL. On power-up of all 6 prototypes, I found SCM was setting and the BDM pod was reporting a bus frequency of 1.48 MHz instead of the 4 MHz I expected from the 8 MHz pierce oscillator with 8M2 resistor across the xtal and two C of 22p each to gnd.
Looking at the board, I saw I had put the PLL filter too far awy from the chip and obviously it was picking up noise in the lands.
So I cut the lands to the PLL filter, bypassed the Vdd PLL with a 100nF at the chip, and all seemed well. For a couple of months I have been successfully develping software using the 6 prototypes. I have got a clean 8MHz clock of 2V p-p from the xtal.
All of a sudden today, all six boards have gone back to a 1.48MHz bus speed! It`s like the laws of physics have changed overnight. I can`t think of anything that has changed.
Since there is little risk to having a cpu failure (it is a ham radio project) I would be happy if I could just disable the clock test circuitry and have it merrily using the 8MHz xtal. Can anybody tell me how to do this, since I can't find any way by reference to the data books.
Or any solution to my problem other than re-designing the board, since it is pro-bono I don't want to shoulder that expense.
Thanks for any help,
Thanks for the reply. Being a radio ham, I have a SW receiver handy, and I can clearly hear the 8 MHz oscillator come on and off as I power up and down the board! Kinda eliminates the scope probe capacitance :smileyhappy:
I also tried clearing CME as my first line of code, but of course you can't do this if SCM is set, which happens before you get to execute any code.
I did discover what was different from previous weeks however: I had been using a 12V power supply with a 100 ohm resistor in series from another project, and the voltage supplied to my board was 7V instead of 12V. This meant that around 3.3 V was being applied to the chip after the voltage regulators. So it seems to work with 3.3V and not 5V. Perhaps the 2V p-p from the xtal is not enough? I tried my original wire-wrapped prototype which works, and found 2V there also, as well as on a tech arts board, so I am not sure what this means.
Again, thanks for any help, it is appreciated. Even one of Baldrick's 'cunning plans' wouldn't be amiss.
Hm, defective crystals?
Are you sure oscilator is oscilating before you touch it with scope probe? If ECLK output is not used in your application, then I would clear NECLK bit in firmware on reset and monitor ECLK output instead of crystal pins.