I see. The datasheet says XT is for 200KHz to 4MHz. Anything above that is HS. I checked the datasheet for PIC16F87 too and that says the same thing yet ive been using one with a 20MHz resonator without setting it to HS. Ill change the 16F877A to HS when i get home
I think you've just been lucky so far. Some of the various oscillator modes (XT, HX, etc) change the 'gain' inside the PIC, drive the crystal/resonator/whatever harder at higher freq's.
The F87 is a bit newer than the F877A. Maybe it's a bit more tolerant of that sort of thing.
So if i set it to XT when it should be HS then i dont risk blowing anyhting up it just means that the resonator might not have enough power to run correctly?
From what ive seen the PIC seems to be in a kind of standby mode. I do remember them doing the same kind of thing if the resonator isnt connected so that might be the problem.
It's got nothing to do with 'power' in the way that you're thinking about it. It's the 'gain' for the oscillating signal that goes into/comes out of the crystal/resonator itself.
The higher the frequency, the more juice you need... i.e. takes more energy to swing an electrical signal back and forth at 20Mhz than it does at 4Mhz. (if you really want to go crazy, pull up the datasheet for any old op-amp and look at 'slew rate')
You won't blow anything by setting the wrong mode, it'll either work or won't. (well, I should re-state that a bit...you SHOULDN'T blow anything up)
How can you actually quantify that 'seems to be in a kind of standby mode'. It's either working for you or not.From what ive seen the PIC seems to be in a kind of standby mode. I do remember them doing the same kind of thing if the resonator isnt connected so that might be the problem.
By that i meant in an idle state where its not doing anything. It doesnt appear to be using any power and its not changing the state of any output pins etc
Ive just reprogrammed the PIC chip with my origional test code but setting the oscillator to HS and it works.
Thanx for your help![]()
Bookmarks