Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Pic timer 1 watch xtal help

Status
Not open for further replies.

dr pepper

Well-Known Member
Most Helpful Member
I've used 18 pin 16 series pics a few times with a watch xtal on timer 1 with no trouble in fact excellent timekeeping.
On this pic16f886 I have the tris bits set as i/p's, and I have tried connecting the xtal to timer1's osc pins directly and with 100k, 47k and 220k ressitors, and tried 20pf and 33pf caps to ground from the xtal.
I cannot get the osc to run, it will either not start or run at 3rd overtone.
On my test breadboard the xtal was connected directly to the pic, no caps or resistors, and it worked, not even that will work now, the osc runs at power on at 3x freq for 2 seconds then stops dead.
I've tried 3 diffrent xtals.
Whats the best way to run a watch xtal and timer1?
 
Where are you putting the resistor? I would suggest that the resistor should be between the oscillator output pin (pin 10 or 11 depending on which oscillator on the pic16F886 in DIL or SO package)
The capacitors must be connected directly to the crystal.
9791.jpg

The 10 M resistor is in the PIC so you don't need to fit it, as long as you get the right oscillator mode.

If the oscillator is running too fast, it is because there is more gain at the higher frequency. That can be caused by a poor layout, the wrong circuit or resistors that are too small.
 
I got it work well, in fact it worked well from the start, its just that I didnt realise.
On previous projects I didnt use caps or resistors, and the osc freq was too low, I made up for it by polling a diffrent bit in timers 1's higher register, and it still kept good time.
Then when I did it properly using 2 caps and a 220k resistor it ran at the right speed confusing me.
 
I think when you saw it without caps on the board, it wasn't a crystal, but pre-made oscillator, which doesn't require caps.
 
I wondered if the capacitance of the xtal was taking effect, but I dont think so as I have a couple of designs without the caps keeping good time, it seems without tuning the xtal resonates 2 octaves lower than its sposed to.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top