Showing posts with label Oscillator. Show all posts
Showing posts with label Oscillator. Show all posts

Saturday, December 20, 2008

Frequency Divider

I am always looking for perfect frequency oscillator for a given budget for my clock projects. Searching on eBay provided a lot of good frequency oscillators including OCXO (Oven Controlled Crystal Oscillator) and Rubidium Frequency Oscillator. Most of them are for telecommunication systems and audio systems. But, I want to use the oscillator just for making a good clock. Yes, just a real clock for telling time.Those oscillators on eBay provide frequencies that not suitable for making a clock. For example, 10MHz,11.2896, MHz, 16.9344MHz etc.,

There are some techniques to make use of these oscillators in clock projects. I have post a solution for 11.2896MHz in "Using 11.2896 MHz with TMR1 (timer1 module)".

For 10MHz oscillator, I will use ripple counters as the frequency divider to divide the 10MHz to lower frequency and use it as a time reference for my clocks. I got information about 10MHz frequency division from Seiichi Inoue's website. From the web, 10MHz frequency can be divided by using 3 pcs. of Dual Decade Counter (74390 or 74HC390). By using the schematic below, I can get 100Hz from 10MHz input. By feeding 100Hz to PIC Microcontroller with appropriate firmware I will get a good accuracy clock.
10MHz Frequency DividerIt's not so easy to divide 16.9344MHz to appropriate frequency for my clocks. However, I will try to figure it out and post it here.

Saturday, November 15, 2008

Using 11.2896 MHz with TMR1 (timer1 module)

11.2896 MHz Rubidium Frequency Standard

A precision clock is my ultimate goal of making clocks. I know that cesium oscillator is to most precise clock on earth. However, a cesium clock is too expensive to play with. My option is using Rubidium oscillator which is the second most accurate oscillator after the cesium (I don't have reference about this) and its cost is more accessible. Searching on eBay about Rubidium Frequency Oscillator brought me to Ultra low jitter 11.2896Mhz Rubidium Frequency Clock . I am thinking about buying this item.
The question is 'How to make use of 11.2896 MHz frequency oscillator with my clock?'. If I run my MCU with this frequency, the internal frequency will be 11.2896MHz/4 = 2.8224 MHz. How to use this frequency to drive timer1 module for making a precision clock? TMR1 is a 16bit timer so it can count from 0 to 65535 before overflow. If I use TMR1 with this frequency without any setting, the TMR1 will send interrupt 2822400/65536= 43.06640625Hz or every 0.023219955 second which is unusable.
I have to find the initial value of the TMR1 for the best precision . The conditions are
1. The number of interrupts per second must be integer so I can count it precis
2. The initial value must be in form 0x##00. That means I have to set only the first 2 bits of TMR1 (TMR1H) as setting the lower bits takes some time and effects the clock precision.

The Solution
Expanding 2822400 results
2822400 = 256 x 49 x 25 x 9 = 57600 x 49
The meaning
If I set TMR1 to count upto 57600, it will send interrupt 49 times/second. Wow! It meets my first condition. To set TMR1 to count up to 57600, I have to set the initial value of TMR1 to 65536-57600 = 7936 = 0x1F00. Wow again!! It meets the second condition.

Now, I have to set TMR1H = 0x1F and count the number of interrupts to 49 to get 1 second time interval. Just perfect!