CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Setting Timers on the PIC16F688?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Tom-H-PIC



Joined: 08 Sep 2003
Posts: 105
Location: New Castle, DE

View user's profile Send private message

Setting Timers on the PIC16F688?
PostPosted: Tue Mar 29, 2011 7:25 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Mar 29, 2011 1:27 pm     Reply with quote

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

View user's profile Send private message

I concur
PostPosted: Tue Mar 29, 2011 4:00 pm     Reply with quote

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: 19510

View user's profile Send private message

PostPosted: Wed Mar 30, 2011 2:05 am     Reply with quote

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....

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group