PIC18F4520 oscillator question

Thread Starter

riad_00

Joined Feb 9, 2008
19
Hi,

I am making a digital clock using PIC18F4520. I am using a crystal oscillator of 32.768KHz with TMR0 timer. I am bit confused and stuck that where I am going to connect the oscillator. From the data sheet it says the oscillator has to be connected in between the pin RA6 and RA7. It also says pin RA4 is the source of TMR0. Can some one cast any light here please???

Thanx in advance
 

beenthere

Joined Apr 20, 2004
15,819
You may be confusing the external crystal oscillator that provides the clock source for the PIC and the timing source for timer0. The first runs the PIC, the second is an input to the timer.
 

Thread Starter

riad_00

Joined Feb 9, 2008
19
So I have to get one oscillator to connect pin RA6 and RA7 and the 32.768KHz one for the timer0 input.

Thanks
 

mik3

Joined Feb 4, 2008
4,843
You can connect only one oscillator on pins RA7 and RA8 to give timing to the whole chip and then define the frequency for timer0 by the software (your code). Note that you have to set the configuration bits appropriately as for the crystal to work otherwise RA& and RA8 will be acting as I/O.
 
Top