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 secondary oscillator

Peet19

Member
Hi All!
I would like to ask, what meaning the secondary oscillator? How to use? I have is a PIC18F24K20 and I was read there it is shared the with Timer1. What is this mean?

Thank you in advance for you help!
 
Solution
It's for such as a 32.768KHz crystal to run a real time clock, or in some cases the main clock can be switched off and the device run from a secondary osc to reduce power consumption when it is near idle.

There are quite a few variations between different PICs, with both internal and external secondary oscillators.

I'd guess that one tied in to a timer is for real time clock use?

rjenkinsgb

Well-Known Member
Most Helpful Member
It's for such as a 32.768KHz crystal to run a real time clock, or in some cases the main clock can be switched off and the device run from a secondary osc to reduce power consumption when it is near idle.

There are quite a few variations between different PICs, with both internal and external secondary oscillators.

I'd guess that one tied in to a timer is for real time clock use?
 
Solution

Nigel Goodwin

Super Moderator
Most Helpful Member
Ok. I understand, thanks.
As an example, here's one of my boards - notice the small crystal and two capacitors just above the PIC - that's the oscillator parts for a secondary oscillator, and runs TMR1 at 32KHz. The PIC spends almost all it's time in sleep, and is woken up every second by TMR1 using the 32KHz clock (which is VERY, VERY low power). It's also woken by by I/O interrupts, which it counts and stores.

The one second interrupt runs a Real Time Clock, which is then used to upload the data at timed intervals, and can be set to do so hourly, daily, weekly, monthly etc. The fact it's asleep almost all the time gives a battery live of five years plus, if it's set to weekly.

This is a very common use for the secondary oscillator, and used in a huge variety of different products.

IMG_0856[1].JPG
 

Latest threads

New Articles From Microcontroller Tips

Top