View previous topic :: View next topic |
Author |
Message |
arunb
Joined: 08 Sep 2003 Posts: 492 Location: India
|
Can a watch crystal be used with a 16F690 for an RTC ?? |
Posted: Fri Oct 30, 2009 3:39 am |
|
|
Hi,
How can I connect a 32.768 Khz crystal to a 16F690 mcu.
I need to use this crystal as a RTC and generate an interrupt. The mcu would work on the internal oscillator at 8 Mhz.
Is this possible with 16F690 ??? I used to do this with a 16F628 and a 16F648A mcu, the PICs derived the RTC timing interrupt from the watch crystal but run on internal oscillator mode.
Please help...
thanks
a |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
|
Ttelmah Guest
|
|
Posted: Fri Oct 30, 2009 6:32 am |
|
|
Yes, but you don't connect the watch crystal to the master oscillator pins.
Connect it to T1CKI and T1G pins.
Then setup Timer1, with T1_EXTERNAL | T1_CLK_OUT, which enables the oscillator between these pins. Obviously add the required capacitors, to get the frequency right.
Timer1 then counts using the external crystal, and you can run the CPU itself off any other clock you want. INTRC_IO, with a clock setting of 8MHz, gves you operation off the internal 8MHz RC clock.
Best Wishes |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Fri Oct 30, 2009 10:19 am |
|
|
Quote: | Yes, but you don't connect the watch crystal to the master oscillator pins.
Connect it to T1CKI and T1G pins. | They are the same with 16F690. |
|
|
arunb
Joined: 08 Sep 2003 Posts: 492 Location: India
|
RE: |
Posted: Sat Oct 31, 2009 3:15 am |
|
|
Thank you for the help..it was the most informative
a |
|
|
|