Getting a resonator to work on a 28X2

LEH

Member
I have a picaxe 28X2 that is programmed. It runs the same speed with/without a 64 Mhz resonator. Using an oscilloscope I see no activity on either resonator pin other than 60 Hz hum.
 

hippy

Technical Support
Staff member
The 28X2 only supports up to a 16MHz resonator which, with a 4 x PLL on-chip, will deliver 64MHz operation. If it is actually a 64MHz resonator then it will be out of spec and the oscillator may not run.

You also need to execute a SETFREQ command with an 'EMx' setting to enable the external resonator.
 

LEH

Member
Added setfreq for 16 Mhz resonator now running faster, see results below.
Basic Stamp BS2SX 199.6 mS 92 mA
Basic Stamp BS2PX 133.7 mS 109 mA
28X2 450.5 mS 41 mA
with res 55.4 mS 51 mA
 

westaust55

Moderator
Looks good now.

I presume that the above posted data should be:
Basic Stamp BS2SX 199.6 mS 92 mA
Basic Stamp BS2PX 133.7 mS 109 mA

PICAXE 28X2 @ 8 MHz default 450.5 mS 41 mA
PICAXE 28X2 with 16 MHz res 55.4 mS 51 mA

450 * 8 / (16*4) = 56 so matches up

Interesting to see that the PICAXE has half the current draw - presume that is whiel driving other components or is that the microcontroller alone in which case uA might be the units.
 

LEH

Member
There were a couple of LED's in addition to the CPU. The same LEDs were used on the Stamp to compare apples to apples. On the stamp code the outpin was given a name and declared as output. Then name = 1 was used in place of high name. To bad picaxe doesn't have this (that I know of).
 

hippy

Technical Support
Staff member
On the stamp code the outpin was given a name and declared as output. Then name = 1 was used in place of high name. To bad picaxe doesn't have this (that I know of).
You can give a pin variable a name such as "Symbol LED = pinC.1" then you can used "LED=1" and "LED=0" to set the pin high and low.

If the pin is not an output by default you need to make it an output before the above will have any affect. That can be done with "OUTPUT C.1" ( or HIGH or LOW ), or by "dirC.1=1".
 

Technical

Technical Support
Staff member
Also note that it is much more common (and faster) to use 'high LED / low LED' commands.
 
Top