[Logo] Anarduino and HopeRF Community Forum
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics     [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Messages posted by: srueger
Forum Index » Profile for srueger » Messages posted by srueger
Author Message
Hi Rick. I love your Anarduinos. Wireless communication is crucial for a lot of applications. Your design is neat with a small footprint, and you have highly power-effective uP solutions!

There will be uP applications that don't need an RTC, and I imagine some people might prefer a "no RTC" option (to save complexity, signals, power etc).

I build clocks, so need time, but many other applications also benefit from time on the node, eg, to log events in memory of the uP node or to make decisions on the local node, eg, switched on light might not be OK at certain times but OK at others (same with heating, open windows, etc). I am a huge fan of the DS3231 RTC. It has an internal temperature controlled crystal oscillator, which makes the RTC very precise (I observe something like 1 second per month - great for synchronous actions between different nodes - but you can get it to be more precise than that, see below). The DS3231 gives you three things by default that are not normally on most uP boards: a stable frequency, temperature readings and accurate time.

A precise frequency on the uP board is good for carrying out frequency measurements and time-stamping events to a reasonably high resolution. I connect the 32k signal (actually, 32,768 Hz) of the DS3231 to the T1 pin (D5) of the ATmega328 as external clock source for the 16-bit counter TCNT1. This cycling 16-bit counter allows me to generate accurate time without interrupts. That is great for driving long LED chains (eg, WS2812). These tend to lose timer interrupts otherwise. The counter is also great for sampling signals (a cheap tiny remote rough and ready oscilloscope anyone?). The counter has a resolution of around 30 us. With that I can read remote control codes en-passant through a cheap 38 kHz IR diode (I've written a little library for Apple remotes and generic TV remotes).

The DS3231 gives you temperature readings as a bonus. These are not super precise, but I find them vvv useful for catching rising or falling temperature beyond certain limits.

For my clock applications I receive the exact time from from an Arduino node with a GPS module on it via the radio link. That allows me to adjust the aging register of the DS3231 to keep its precision well under the advertised 1 ppm (even when the time master is switched off).

So for me, the Anarduino would just be perfect with a DS3231 option (and solder bridges for connecting the 32K signal to D5 and the square wave frequency to D3).


PS: Ahh, and the DS3231 has double buffered time registers, so you can read and write the time whenever you like. A read attempt copies the RTC time into a buffer, and happily increments the time internally so that the read command receives a consistent copy. Same with a write, where the time is first copied into a buffer. After finishing writing the time is transferred to the RTC at once (and no intermediate increments can corrupt the written time). In contrast, the data sheet of the MCP7940N version says that the time may be corrupted when writing the time during an increment - which means that this current RTC requires a bit of a workaround in software.
Forum Index » Profile for srueger » Messages posted by srueger
Go to:   
Powered by JForum 2.1.9 © JForum Team