OK, I believe the X2 are running at 8 MHz. But I do not think the resonator is active.
Have you enabled the external resonator with a SETFREQ EM
xx, and have you matched the EM
xx value to the resonator frequency ?
Remember that on the 28X2 the times-four PLL is automatically enabled for the external oscillator. If you have an 8MHz resonator attached you should be using "SETFREQ EM32".
It is hard to imagine the basic starting out with the internal clock, then checking to see if there is a resonator there!
That's the way it works except on those PICAXE which require a permanent resonator or crystal to be attached. The PICAXE starts with an internal oscillator, is switched to use the external oscillator with the SETFREQ, and if the resonator isn't there, if the oscillator doesn't oscillate for whatever reason, the internal oscillator automatically takes over again.
For those which don't have the fail-safe fall-back, when switching to external oscillator, if it doesn't work, everything probably will stop dead.
If not, when it goes to run with it, everything stops and it would get stuck.
That is the case when for a PICAXE which requires a resonator to be permanently attached, and those which don't have a fail-safe oscillator capability.
There are 2 registers to set the OSC: OSCCON and FOSC. I am going to read about them and attempt to jam some values in there to select the ext osc.
You should not have to do anything beyond using the SETFREQ command.
Another thing that bugs me is page 167 of The Manual, setfreq. It says:
ON DEVICES WITH FIXED EXTERNAL RESONATORS THIS COMMAND CANNOT BE USED - you have to change the resonator.
That would imply my 28X2 is preset for the ext resonator, which I think I proved it is not.
"On devices with fixed external resonators", which means those which must have a resonator permanently attached to work; such as the older 28, 28A, 28X. That does not include the 28X1 or 28X2, nor other current PICAXE.
The 28X2 can use either the internal or external oscillator. When it starts up it will use the internal osciallator at 8MHz until you instruct it to use something else with SETFREQ.
Also, commands like setfreq k31 or setfreq em16 do not do anything, but I guess they would not since you can't use setfreq with this chip, so why are they listed?
The command is available for the 28X2 and all options should be functioning correctly.
The quickest way to prove that may be to have a SERTXD loop which will output at 9600 baud with the normal 8MHz. Add a SETFREQ, and as that changes, so too will be baud rate. If the message can be seen at 9600 baud, using "SETFREQ M4" will require the baud rate of the Terminal viewer to be halved to 4800 baud for the message to be readable.
Sorry for having problems, I chose this chip as a quick way to solve a problem with the Hertz display on a very expensive generator control.
It should be easy, no more than using the correct SETFREQ. Perhaps you should post your full code and full circuit diagram then we can see exactly what it is you are doing.
The only thing I can think is that you are selecting the external oscillator, there's a fault with the resonator or related hardware, so the chip is fail-safe dropping back to internal oscillator operation, or you've mis-matched resonator to SETFREQ setting. Neither of those should affect any ability to use "SETFREQ M4" or any other internal oscillator speeds though.