Joined: 08 Sep 2003 Posts: 105 Location: New Castle, DE
Setting Timers on the PIC16F688?
Posted: Tue Mar 29, 2011 7:25 am
Ok I must be missing it or this PIC will not do what I think it will.
I'm working with a PIC16F688. I read the data sheet about a 100 times and tested code about the same amount. Not seeing how to make this work
I'm trying to get one of the timers to run from the 31khz oscillator.
I'm using the internal oscillator at 8Mhz for the main oscillator.
What I trying to do is operate the PIC from the main oscillator at 8Mhz and have one of the timers give a 1ms interrupt with the other timer running from the 31khz as a RTC with a 1 sec. interrupt.
If this will work some pointers on setting the configuration registers would be outstanding.
Thanks all
Tom
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Tue Mar 29, 2011 1:27 pm
Look at the block diagram in the data sheet.
Quote:
FIGURE 6-1: TIMER1 BLOCK DIAGRAM
I don't see any special internal connection possibility for the internal
31 KHz oscillator.
The proper way to do an RTC, is to connect a 32.768 KHz watch crystal
to the Timer1 oscillator pins. (with two 22pf or 33pf capacitors)
Tom-H-PIC
Joined: 08 Sep 2003 Posts: 105 Location: New Castle, DE
I concur
Posted: Tue Mar 29, 2011 4:00 pm
Thanks for the reply!
That is the conclusion that I came to.
I was getting hung-up on section 6.2.2 of the data sheet and the statement the "Timer 1 can use the LP oscillator"
Tom
Ttelmah
Joined: 11 Mar 2010 Posts: 19549
Posted: Wed Mar 30, 2011 2:05 am
That is for it's own LP oscillator on the external pins. Register 6-1, bit3.
The internal 31KHz oscillator, would not really be accurate enough for any form of timekeeping anyway....
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum