Propeller accuracy?
Ravenkallen
Posts: 1,057
I was wondering if the Prop's timekeeping functions are accurate enough to create a basic digital clock? losing a few seconds a day is an acceptable margin. I know this question has a lot to do with the type of crystal/ oscillator that the prop is using. So you should assume it uses the common 5 MHZ/ 6.25 MHZ crystals that Parallax sells. If it is capable of serial communications up to 14 mega baud, it should also be capable as a digital clock. Right? Or should i use my DS1307?
Comments
-Phil
Cheers,
Peter (pjv)
For example it would keep track of the last date / time it was set, and say it was set 30 days ago and is reset, then was 30 seconds fast. From then on it would subtract a second each day (or whatever).
In theory if you set it exactly, then subsequently set it exactly, then eventually it should keep pretty accurate time.
Sort of like our "leap seconds"...
http://en.wikipedia.org/wiki/Leap_second
-Phil
Problem is the crystal frequency changes with temperature. Check the temperature coefficient specification.
Solution is to build a little "crystal oven" that keeps the crystal at a constant temperature. A bit above your highest ambient temperature at your locality.
Perhaps glue the xtal to a power transistor whose current is pulse width modulated by the Prop. Have a temp sensor for feed back. Keep the xtal and power transistor nicely thermally insulated.
Cheers,
Peter (pjv)
I thought it was pretty cool. I don't have a radio to pick up the clock signal but I do have a couple GPS modules. I thought I'd use the GPS to occasionally update the time of my software clock.
Duane
They transmit a 1 bit per second BCD code that's tied to a (bank of) cesium atomic time references.
I had a Mazda RX-7 years ago with a similar analog clock.
Set it forward - runs faster
Set it back - runs slower
Daylight savings time took about 2 weeks to stabilize. PITA! :mad:
http://macetech.com/store/index.php?main_page=product_info&cPath=5&products_id=8
http://www.maxim-ic.com/products/timers/DS3231_demo/
And that's what things like my watch use to adjust the time (it checks every day in the early morning).
For microcontroller-based projects, it seems to be becoming more and more common to use a GPS receiver to get the time. They are getting pretty cheap these days (I don't know the cost of buying/building a receiver for the "atomic clock" time). The receiver may need to be near a window (but the "atomic clock" receivers can depend on this as well).
GPS will work anywhere in the world. There are "atomic clock" broadcasts in the US, Japan, and Europe. They are at different frequencies and may be different protocols. I don't know about the rest of the world.
I'd probably go with either a more accurate device (like the macetech one) or a GPS receiver.
.Steve
Just a simple experiment. Measure the xtal frequecny at different ambient temperatures. Then you know how much it gains/looses at each operating temperature. Then if you completed clock had a temperature sensor software compensation could be applied.
Of course it's not so simple to do properly as you would need a temperature (variable) controlled environment and an accurate counter to measure it's frequency.
I ran the DS1307 for several weeks (using the RTC code in the obex) and was surprised just how accurate it was, within a second or two. With a A 12.5pf xtal connected to the DS1307, you really shouldn't see more than 10ppm deviation when running from 32f - 100f. That's an error of 30 seconds a month. Getting drift of 10 seconds a day is either a temperature issue or a bad pcb design.
Really, though, I bet the prop xtal will be sufficiently accurate for this project. Cheaper & simpler, too. You could always use a TXCO on the Prop, too.
I ordered a couple of the Chronodot modules - I guess I'll see how accurate they are...
Most microprocessor crystals above 1 MHz are AT-cut, which means that there is a point of inflection in their freq/temp curve just above room temp. If you can target this temperature with a small and simple homemade crystal oven, amazing stability can be achieved. That's an OCXO.
A TCXO can use a thermistor to change the operating properties of the oscillator circuit (such as by including a varactor diode in place of a fixed capacitor) or by counting the crystal oscillations differently. It was this second approach that was used with the 16c54. The short-term average temp guided minute changes to the frequency divider chain, sometimes amounting to a one or two count difference across several minutes time. That is one of the great things about modern high speed microcontrollers - you can count and act on every cycle of a 4MHz crystal oscillator.
One other fun thing to try is operating a crystal at an odd overtone, typically 3rd or 5th overtone. Everything else being equal (and they never are) this produces a higher crystal "Q"
It handles leap year up to 2100 and has two alarms
Features:
Accuracy ±2ppm from 0°C to +40°C
Accuracy ±3.5ppm from -40°C to +85°C
Battery Backup Input for Continuous Timekeeping
Operating Temperature Ranges
Commercial: 0°C to +70°C
Industrial: -40°C to +85°C
Low-Power Consumption
Real-Time Clock Counts Seconds, Minutes,Hours, Day, Date, Month, and Year with Leap Year
Compensation Valid Up to 2100
Two Time-of-Day Alarms
Programmable Square-Wave Output
Fast (400kHz) I2C Interface
3.3V Operation
Digital Temp Sensor Output: ±3°C Accuracy
Register for Aging Trim
RST Output/Pushbutton Reset Debounce Input