4 or 8MHz resonator doesn't appear to make any difference - huh?

Eclectica

Member
Hi,

Firstly thanks for reading this.

I have the AXE022 proto board running fine. Also I have just made a 28X1 board which is also working fine. Both have 4MHz resonators as default.

When I change the resonator on either board from 4MHz to 8MHz nothing seems to change!
i.e. LED flash rate using pause command is unchanged, and AXE022 to AXE033 LCD display using serout at 2400 still works! :eek:

I have soldered in the 8MHz resonator into the AXE022 proto board behind the existing 4MHz resonator. After powerdown and change over J4 and J5 (swaps 4MHz and 8MHz resonator connections into PIC) it still works as if running at 4MHz.

It did occur to me that the setfreq directive might make a difference here, but surely this is a hardware change and the s/w should run at double speed (pause is listed as being affected by resonator speed in the manual).
It would appear that the external resonator is being ignored and the devices are using internal ~4MHz whatever.

Just wondering if anyone with more experience of using PICAXE with different speed resonators could throw some light on this? It would really help!

Regards
Michael
 

hippy

Technical Support
Staff member
It did occur to me that the setfreq directive might make a difference here, but surely this is a hardware change and the s/w should run at double speed

No, the 28X1/40X1 run on an internal 4Mhz oscillator unless told otherwise. It doesn't care if there's a crystal there or not or what speed it is until you issue a SETFREQ command.
 

womai

Senior Member
You explicitly need to tell the 28X1 to use the external resonator:

setfreq em8

Otherwise it will default to its internal oscillator running at 4 MHz. I recommend looking up the setfreq command in the Basic manual for more detailed info.

The 28X didn't have this (slightly confusing) issue because it can only run on an external oszillator.

Wolfgang
 

Eclectica

Member
Thank you very much for your informative replies hippy and womai.

Aha, it makes a whole lot more sense now!

I think I was mixing up my commands and directives :rolleyes: #freq & setfreq :eek:

Also the last time I used a PIC was the old EPROM based 16C55/7s etc. where the whole thing was entirely dependent on external xtal/caps/track capacitance/ground plane being just so.

To me it is a bit of a new concept to be able to change frequency by program execution within a microcontroller - I like it. :)

All is working correctly now and now the jumper settings make a difference!

Thanks again.

Michael
 
Top