PowerSpike
New Member
I've repeated the test using a fresh 16Mhz Resonator and a breadboard (no cooking of the components).
Minimum circuit with no complications:
Resonator connected to legs 8,9 and 10
Ground connected to legs 8 and 19
+5V regulated connected to Leg 20
1K Pulldown on Leg 6 (Serial In)
4.7K Pullup on Leg 1 (Reset)
LED+Resistor on Leg 2
By timing the LED flashes which occur at 1 per second at 8Mhz I am now getting 2 per second with em64 enabled.
If I pull the resonator out the LED continues to flash at the same rate when it falls back to using the internal clock so it looks like the chip is stuck at 16Mhz (internal) and ignoring the external resonator. Very strange.
The fact that it goes up from 8Mhz to 16Mhz proves that it's eating the setfreq command but it's not doing what one would expect.
Given that the circuit and the program are so simple I am running out of things to try.
As suggested, I also tried setfreq em16 to get the external resonator to kick in (at it's fixed value) which should have also resulted in 64Mhz but again I ended up with 16Mhz Internal.
I also tried the following code:
setfreq em64
peeksfr 0xD3, b3
clearbit b3,0
peeksfr 0xD3, b3
In theory this should have triggered the chip to use the external clock if I have understood Mr Hippy's suggestion.
This also left things running at 16Mhz Internal.
Although I can rewrite my original program to cope with making measurements at a lower clock speed it would have been great if the 64Mhz mode could be used as it would increase the resolution of my timers.
This is all jolly good fun though so please don't think I am getting angry or anything. I love these PICAXE chips and like to find out how things work.
Minimum circuit with no complications:
Resonator connected to legs 8,9 and 10
Ground connected to legs 8 and 19
+5V regulated connected to Leg 20
1K Pulldown on Leg 6 (Serial In)
4.7K Pullup on Leg 1 (Reset)
LED+Resistor on Leg 2
By timing the LED flashes which occur at 1 per second at 8Mhz I am now getting 2 per second with em64 enabled.
If I pull the resonator out the LED continues to flash at the same rate when it falls back to using the internal clock so it looks like the chip is stuck at 16Mhz (internal) and ignoring the external resonator. Very strange.
The fact that it goes up from 8Mhz to 16Mhz proves that it's eating the setfreq command but it's not doing what one would expect.
Given that the circuit and the program are so simple I am running out of things to try.
As suggested, I also tried setfreq em16 to get the external resonator to kick in (at it's fixed value) which should have also resulted in 64Mhz but again I ended up with 16Mhz Internal.
I also tried the following code:
setfreq em64
peeksfr 0xD3, b3
clearbit b3,0
peeksfr 0xD3, b3
In theory this should have triggered the chip to use the external clock if I have understood Mr Hippy's suggestion.
This also left things running at 16Mhz Internal.
Although I can rewrite my original program to cope with making measurements at a lower clock speed it would have been great if the 64Mhz mode could be used as it would increase the resolution of my timers.
This is all jolly good fun though so please don't think I am getting angry or anything. I love these PICAXE chips and like to find out how things work.