Resonator question.

xtech007

Senior Member
Once again thanks for your time !
I would like to know what's the resonator used for, Maybe the right question would be if improves the way the code runs or does it has to do with hardware?
I'm Using a 28x1 chip and gathering data from a analog Potentiometer, it seems to be reading too slow compare to the output.

any Ideas would be greatly appreciated.
 

ylp88

Senior Member
The resonator sets the operating speed of the microcontroller. For most PIC chips (upon which the PICAXE is based), one line of assembly code is processed very four clock cycles. So using a 4 MHz (4 million cycles per second) resonator, crystal or other oscillator as the clock, will result in 1 million instructions being executed per second.

Note that a line of PICAXE code is not one line of assembly code, so execution speed is much slower. However, if you want you program to run faster, you may be able to use a faster resonator (up to a finite specification limit). Remember to compensate for things like serial communications also becoming faster as a result, though.

ylp88
 

Brietech

Senior Member
On a related note, how fast can one run a 28X2 chip? Various sources appear to say anywhere between 32 MHz and 64 MHz. Does anyone have a firm answer?
 

westaust55

Moderator
On a related note, how fast can one run a 28X2 chip? Various sources appear to say anywhere between 32 MHz and 64 MHz. Does anyone have a firm answer?
Believe I read somewhere that the allowable speed as a PICAXE relates to having correct serial comms baud rates.

Manual 1 page 15 indicates the 28X2 and 40X2 as 40MHz
the 20X2 is rated to 64MHz

Then on page 16 it states X2 parts up to 64MHz - to me that means some not all to 64MHz, so deferred to page 15.

Page 31 has some further information:
nominal 5V 28X2 parts have a max of 40MHz, whereas the 3.3V parts have a 64MHz internal clock limit.
Ditto on page 35 for the 40X2 parts
with another summary on acceptable resonators and clock frequencies on page 39.
 
Last edited:

hippy

Ex-Staff (retired)
On a related note, how fast can one run a 28X2 chip? Various sources appear to say anywhere between 32 MHz and 64 MHz. Does anyone have a firm answer?
The 28X2 (5V) can go up to 40MHz using an external crystal of 10MHz. 32MHz is the practical maximum if requiring SERIN / SEROUT comms using standard baud rates with an 8MHz crystal.

The 28X2-3V can go up to 64MHz using an external crystal of 16MHz.

The 20X2 will go up to 64MHz using the internal oascillator.
 
Top