3
\$\begingroup\$

All RTCs I've seen so far operate from a 32.768kHz crystal, which can't be divided to 100Hz. Are there 32.000kHz RTCs?

\$\endgroup\$
3
\$\begingroup\$

The only RTC I know of which worked with hundredths of a second was the long obsolete Intersil ICM7170. The datasheet isn't clear how the 100Hz was achieved. The crystal frequencies which it was designed for are perfect powers of 2: 32.768kHz (i.e \$2^{15}\$), \$2^{20}\$Hz, \$2^{21}\$Hz, \$2^{22}\$Hz, yet the datasheet says it derives a 4000Hz clock from them, from which the 100Hz is derived. 32768Hz is not a multiple of 4000Hz, so this can't be done with a normal divider. They probably used a fractional divider, like supercat describes.

Anyway, the ICM7170 is obsolete, so we need something different. While there might not be 32kHz RTCs, there are 32.000kHz crystals, and with a 74HC4060 you get an oscillator + divider.

enter image description here

The 32kHz crystal probably needs the same load capacitor as a 32.768kHz crystal. The 330k\$\Omega\$ resistor limits the drive power to the crystal. This is significantly higher than the 2.2k\$\Omega\$ recommended by NXP; a 32kHz crystal typically has a drive level of less than 1\$\mu\$W. If the oscillator doesn't start decrease the resistor's value somewhat.
Use the :32 output Q5 (pin 5) to get a 1kHz clock which you can feed to your microcontroller interrupt pin.

enter image description here

You can then use the 1kHz heartbeat interrupt to derive a 10ms software timer.

edit
Alternatively a microcontroller can be used. This will be slightly more expensive than the 74HC4060, however, and might also consume a bit more power. I've used TI's MSP430F1101 at 32kHz and 3.3V which needed only 4\$\mu\$A though. Run it off the 32kHz crystal and use a timer to output the 100Hz signal. You can even output different frequencies simultaneously, for instance 1000Hz, 100Hz and 1Hz, or select the frequency on a specific output by setting a pair of I/O pins. Or you can select the frequency via the UART.

|improve this answer|||||
\$\endgroup\$
1
\$\begingroup\$

What do you want the 100Hz for? It's easy to turn a 32768Hz signal into a 12800Hz signal with +/-31us of jitter, using a circuit that outputs 25 pulses every 64. With a little more work, one can reduce the jitter to +/-16us. With a bit more work still, one can reduce the jitter to +/-9us plus half the asymmetry of the input clock (so if the input clock is 12.5us high and 18us low, jitter would be +/- about 12us). I don't know of any current-production standard devices to do that, but it would be easy in a CPLD or FPGA. All but the last would fit in a 16V8; the last could probably be done combining a 16V8 and an external JK flip-flop. Incidentally, one could if desired, with a fairly similar amount of circuitry, generate 16,000Hz with the same amounts of jitter (output 125 pulses every 256).

|improve this answer|||||
\$\endgroup\$
  • 1
    \$\begingroup\$ If you don't use an RTC IC IMO there's no reason to stick with the 32.768kHz crystal. Granted, the 32.000kHz crystal may a bit more expensive, but not as expensive as a CPLD. And it doesn't show \$\mu\$s jitter. \$\endgroup\$ – stevenvh Oct 4 '11 at 6:17
  • \$\begingroup\$ @stevenvh: If one doesn't need a CPLD for anything else, a 32000Hz crystal and binary counter could easily be a better choice. On the other hand, it's useful to know what options exist. I was suggesting the 16V8 not so much with the idea that one would use a 16V8 just for that purpose, but because 16V8's are popular enough that I figured readers would know about how much logic that represents. If any programmable logic is needed for some other purpose, the programmable logic device (of whatever form) may be able to do the rate conversion as well. \$\endgroup\$ – supercat Oct 4 '11 at 14:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.