Seeking RTC suggestion

Go To Last Post
14 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have a low-power display clock application.  I'd like to keep the MCU sleeping until awakened by a time update interrupt every minute, at which point it will update the display.  One approach is to use an external clock to drive one of the MCU's timers which wakes the MCU on overflow.  Another, potentially lower-power approach, though, would be to have an external RTC wake the MCU every minute, obviating the need to run a timer.  Does anyone know of an RTC that can do this?  Of course, Maxim comes to mind, but their product selector isn't amenable to this sort of search, and they have so many RTCs I'd prefer not to wade through all their datasheets.  I figured someone here might know.  I also sent a note to their tech support.  Thanks.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DS3231.

 

If I am reading the datasheet correctly, you can generate an interrupt once every minute.

 

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I used DS1307 with ATmega8
Easy to interface via I2C,

has a square wave output,
but I didnt use squre wave output I m not sure if is adjustable to 1 min or not
Take a look

Majid

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

m.majid wrote:
I used DS1307 with ATmega8 Easy to interface via I2C, has a square wave output, but I didnt use squre wave output I m not sure if is adjustable to 1 min or not Take a look

Don't bother looking. The DS1307 cannot produce minute by minute outputs.

 

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Intersil ISL12022 - does Daylight Savings Time adjustments (if you care). 

If you want to spend money, ST Micro M31T11 and a 'SnapHat' battery ($$$!!!).

If you want to run off a box of AA batteries, MicroChip MCP7940 (can tolerate 6.5V as Vcc).

 

I used a 1F (One farad) cap as 'backup battery' and it kept time with power off for at least two weeks. 

 

S.

 

PS - IMHO, the internal AVR "RTC" sucketh.  The one I tested lost seven and a half seconds a day.  Could have been a bum Xtal, o'course.  S.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think it's probably best if you sharpen your teeth and bite through some datasheets yourself.

(Almost) every external rtc chip is going to have a bunch of alarm functions.

 

Some of the important differences between rtc chips are:

- Power consumption.

- Accuracy. (xco, txco, etc).

- Price.

- Built in crystal ( Txco, but also better accuracy because no stray capacitance from the pcb).

- Possibility for callibratrion.

 

DS1307 has long been the "default" for hobbyists, but is an old design, and not very accurate (depending on crystal, board layout, etc).

DS3231 has built in txco and claims 2ppm accuracy over a reasonable temperature range.

Both of these are cheap from Ebay/Ali and oftten come on a breakout board for easy prototyping.

But be weary. These chips are (often?) clones.

Just recently there was a post here about DS3231 losing time if the time was read out too often from the chip.

 

Do you know that most avr's have a built in oscillator for a 32kHz watch crystal?

 

For a vendor independent overview you can have a look at octopart:

https://octopart.com/search?q=rt...

 

Also: Real low power circuit design is not trivial and a real art in itself.

Quiescent current of a voltage regulator, a single careless designed pullup resistor, or a leaking capacitor can easily become the dominant power hog, even when it is operating perfectly and within spec.

 

Leakage current of semi conductors is also very temperature dependent.

Leakage roughly doubles  about every 10 degees C temp incease.

(That is 3 orders of magnitude over a 0C to 100C temp range).

Doing magic with a USD 7 Logic Analyser: https://www.avrfreaks.net/comment/2421756#comment-2421756

Bunch of old projects with AVR's: http://www.hoevendesign.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks everyone. Looks like the DS3231 will work. I haven’t implemented I2C on bare metal before (just through Arduino). Anyone have a favorite C library? I’ve done SPI from scratch, but I hear I2C is a bear to do that way.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Also: Real low power circuit design is not trivial and a real art in itself.

Also don't forget (as is often overlooked) that "waking up" (a power supply) momentarily may charge up a bunch of power caps, that slowly sink back towards zero, only to be topped off again every minute-- possibly erasing much of the power savings. So this needs engineered carefully.  In fact, since the recharge occurs in brief high current burst & losses are related to the square of the current, a high current burst can lose more power, than a continuous lower current.  Watch your design closely.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yeah, I'm prepared for this to be a learning experience.  It will be a battery-powered device, so there won't be any power-supply caps to power up, but the decoupling caps, and any caps inside the MPU will eat some power.  I figure I'll breadboard the basic design, make some measurements, and go from there.  The actual display will be e-ink, which draws nothing between updates, so the continuous draw will just be the RTC and the sleeping MCU.  If I can get a year of operation out of a couple of AAA cells, I'll be satisfied.  On paper, that looks reasonable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have a low-power display clock application. 

 

....how much power do you hope to save by merely stopping the processor.?..are other circuits being powered down too (sensors, amplifiers, etc)...try to provide more specifics (such as how much the running display takes).  You'll certainly have bypass caps.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Sun. Jan 7, 2018 - 04:54 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Avrcandles, see my last post (just before yours).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

lautman wrote:
I haven’t implemented I2C on bare metal before (just through Arduino). Anyone have a favorite C library?

 

Peter Fleury

http://homepage.hispeed.ch/peter...

 

I2C Master Interface.

 

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Scroungre wrote:
PS - IMHO, the internal AVR "RTC" sucketh. The one I tested lost seven and a half seconds a day. Could have been a bum Xtal, o'course. S.

Almost certainly "your" fault. By using a watch crystal that matches the AVR oscillator and internal loading capacitors it is possible to achieve about 20ppm at 23°C. (~ 1.7s/day). The current consumption can also be sub 1uA if designed with low power in mind. The datasheet goes into some detail on the low power watch crystal oscillator.

 

Extract From: Atmel-8284-8-bit-AVR-microcontroller-ATmega169A_PA_329A_PA_3290A_PA_649A_P_6490A_P_datasheet.pdf

The Low-frequency XTAL Oscillator is optimized for use with a 32.768kHz watch XTAL. When selecting XTALs,
load capacitance and XTAL’s Equivalent Series Resistance, ESR must be taken into consideration. Both values
are specified by the XTAL vendor.
ATmega169A/169PA oscillator is optimized for very low power consumption, and thus when selecting XTALs, see
Table 9-7 for maximum ESR recommendations on 9pF and 6.5pF XTALs

...

 

In short - Iif your AVR supports it, don't be frightened of using the "8-bit Timer/Counter2 with PWM and Asynchronous Operation" clocked from the low power watch crystal oscillator. My experience of this has been good.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sometimes you can add a very small trim cap ("pot"), that you can dial in to tweak the freq so it is right on the nose---I seem to remember seeing one in some old digital watch.

Of course you could also rescale the time slightly in software (a software cal)...though more for display purposes than IRQ purposes.

You could also add/delete one second in the clock register every 50000 ticks, or so.

 

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Mon. Jan 8, 2018 - 12:00 AM