Prox / RFID
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Resume / Consulting
Contact Me

LDmicro Forum - Crystal Problems

(you are viewing a thread; or go back to list of threads)

Crystal Problems (by Tom J.)

I am truly disappointed in myself as I write this.

I've been trying for days to run with a 20MHS crystal on PIC16F628A & PIC16F886 and neither will run with the crystal despite trying everything so I'm submitting everything here and maybe one of you guys will point to a simple rookie mistake.

I can run this on the internal oscillator just fine

1) Changed the crystal 3 times
2) Tried Ceramic Capacitors at 30 pf (marked 300J)
3) Tried Ceramic Capacitors at 22 pf (marked 200)
4) Tried LDMicro CONFIG and also tried multiple combinations on CONFIG bits in
the Minipro software (Always 10, HS OSC)
5) MCLR both high and open

I'm open to any suggestions, making a few posts so I can get some screenshots and the very simple ladder posted.
Thanks, Tom
Tue Oct 2 2018, 21:51:48, download attachment 628A20mhz.ld
(no subject) (by Tom J.)
CONFIG Settings (run fine when the osc is set to 101
Tue Oct 2 2018, 21:56:18, download attachment NoRun.png
(no subject) (by Tom J.)
PIC16F628A oscillator CONFIG
Tue Oct 2 2018, 21:57:48, download attachment Screenshot from 2018-10-02 21:49:04.png
(no subject) (by Tom J.)
The Circuit
Tue Oct 2 2018, 22:00:42, download attachment Board.jpg
(no subject) (by Tom J.)
Sorry for the typo, 22pf caps are marked 220. Crystals have all been 20 MHZ
Tue Oct 2 2018, 22:02:59
(no subject) (by MGP)
It looks (size) like your capacitors are 220pF instead of 22pF.
You must be very sure!
Wed Oct 3 2018, 04:53:26
(no subject) (by Tom J.)
And as usual you were exactly correct MGP!

I was trying to use caps from a big box that's been in my lab for decades, bad, wrong, I don't care they're all going in the garbage.

We have exactly one electronics supply local and they have only a few things in stock and way too expensive but I did find two variables there and once I installed them all I had to do was dial them a tad to get it running. Check that thread where we were discussing serial LCD when you get a chance! Tom
Thu Oct 4 2018, 00:53:25
(no subject) (by Tom J.)
A quick question, if one were to put variable caps in the oscillator would the frequency be tuneable within a small range around the crystal frequency?

I'm disappointed that I don't know, this is still a new level.
Sat Dec 1 2018, 02:03:22
(no subject) (by MGP)
If you search on ' frequency counter 16F628a schematic' then you can see that almost all the circuits are using variable caps.

Or at the end of this thread you can see how Jonathan use the cycle time to change the accuracy of the clock.

Sat Dec 1 2018, 02:26:09
(no subject) (by MGP)
I forgot to say that Ihor has solved this bug but you can still use his formula.
Sat Dec 1 2018, 02:29:03
(no subject) (by Tom J.)
Thank you MGP, that's an interesting read, and a tiny bit of unintentional comedic value to boot.
I'm counting cycle time so I can simply tweak the count like Jonathan recommended.
To be safe I should run the variable caps as well and ensure the oscillator is accurate.
Sat Dec 1 2018, 03:09:16
Post a reply to this comment:
Your Name:
Your Email:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):