PDA

View Full Version : Crystal oscillator problems on a 16f628a



achilles03
- 16th February 2009, 04:53
I'm having some trouble with my crystal oscillator. It worked fine on another 16f628a, but I've soldered some more components to my prototype board (and I accidentally bent the pins on the original PIC), and the replacement 16f628a isn't working. But when I set it to internal oscillator, it works, so I know it's the xtal oscillator...

I have a 20MHz xtal with the standard 22pF caps. I'm wondering if the addition of nearby components or heat from additional soldering could have affected the circuit? I also have the caps tied to 5V, not GND (which has worked in several previous circuits, including this one... until now...)

Any suggestions what might have caused the oscillator to stop working?

Thanks in advance!
Dave

Archangel
- 16th February 2009, 06:47
Any suggestions what might have caused the oscillator to stop working?

Thanks in advance!
Dave You are sure the config statement is set to HS_OSC, Yes?

sayzer
- 16th February 2009, 10:38
You are sure the config statement is set to HS_OSC, Yes?

In addition to Joe's,

Not all 16f628A chips work at 20Mhz. You MUST make sure its type is 20Mhz.

Also, 15pf instead of 22pf for 20Mhz has always been better in my applications.


--------------------

Acetronics2
- 16th February 2009, 12:10
Hi,

If it is an existing board ... I'd first carefully clean all the "touched" PCB , verify all Pic pins are correctly soldered ( Laugh, ... who never forgot a pin ??? ) and no short ...

Magnifying glass required ...

Then, if no success ...Try you chip on a breadbord with the ol' famous "Blink" program ... you'll know if it is OK. and
where to look at ...

Alain

PS: 4 Mhz chips are not supposed, but work really fine up to ... 28 Mhz !!! ( no µchip warranty ... of course ...)

achilles03
- 16th February 2009, 15:43
You are sure the config statement is set to HS_OSC, Yes?

Ah ha, that might be it... I have the configuration word set to XT on the pull-down menu (I don't typically set the oscillator type in the program). I guess that should be set to HS. Odd that the previous 16f628a worked with the same oscillator on XT. I guess that XT occasionally works for 20Mhz xtals?

Thanks!
Dave

Acetronics2
- 16th February 2009, 16:33
Odd that the previous 16f628a worked with the same oscillator on XT. I guess that XT occasionally works for 20Mhz xtals?

Thanks!
Dave


YES !!! It may happend ... I discovered once the "horrible truth" on one of my 16F877 ...

It was working @ 20 Mhz with a XT setting ... next one never wanted to work !!!

Alain