Beware! T4x RTC power consumption

bicycleguy

Well-known member
Thought I was getting defective CR1220 button cell battery's. However, measuring RTC currents:
T3.2 1.24uA
T4.0 30uA

Doesn't seem like much but with a 35mAH, 20mm dia. coin cell battery that's only 48 days vs 3 years.
Still great for power failures but not so good for keeping time on intermittent use projects.

According to IMXRT1060 data sheet an External crystal setup can be lower. Not sure if Teensy board can accommodate that?
 
Good info - I had a cell on probably the TallDog T_4.0 board and found it dead - thought I had used a weak battery. Put in fresh and it worked - removed battery when I set them aside assuming perhaps there was high current draw. Getting that current down would be nice if possible. Maybe it deactivates some of the wakeup code the rtc processor can run?
 
Last line of my post above is incorrect. The T4 and T4.1 already have the external crystal. Data sheet Table 4.1.6 suggests 20uA. Not sure why I see 30.
 
Correction noted :( - no easy fix from alternate crystal power - which I misread as just a setting to lower power on the existing use of the crystal.

The speculation about the rtc low power core being active for wakeup would be interesting is there was a way to disable that to get lower power. But that would involve reading the manual to see if it has an "RTC maintain time only mode" and having that wakeup core more idle ? The more involved wakeup LP core seems unique to the 1062 - where the T_3.x just sleeps only ticking the clock with a less involved wake system that might account for the larger power draw? Though if it suggest 20uA then maybe it is just how the 1062 eats more power.

Dead battery may have been on T_4.0 beta board as Paul had a cr2032 on one iteration of that ( though probably not as that has more mA and was plugged in mostly ) - TallDog fitted the smaller CR1220. Those T_4.0 beta boards mostly set aside after T_4.1 went beta [last programmed Apr 22 2020 13:11:55] - have not checked the state of the CR2032's still in place lately.

Just powered and programmed that T_4.0 beta board and indeed the CR2032 is dead - it had the time that survives across Power Off while plugged in - but pulling power and replugging loses the time and the cell measures 0mV
 
I’m reluctant to revive an old post, but…
Is this still a thing?
My new design moves from Teensy 3.2 to 4.1. I’ve been relying on VBAT to keep the RTC alive “forever”
Do I need a different solution for that?

Short question:
How long will a CR2032 last on a Teensy 4.1 when it is off?
 
That’s more reassuring.
My product has been in the field with Teensy 3.2 for about a year. No known dead batteries.
With 1.5-2 year coin cell life, I’ll want to consider customer change-ability, or an easy mail-in service to change it.
I’d welcome other reports as well, or a formula and usage criteria for the Teensy 4.1’s sleep options to predict my expected times.

But hey, way better that the feared 48 days (above)!
 
Silverlock, are the durations you reference in standby configuration (no power to VIN on the Teensy) or while the Teensy is powered and operating?
 
Hi Davidelvig,

I am in a similar boat, moving designs from Teensy 3.5 to Teensy 4.1.

I've tested 3 x Teensy 4.1 boards (1 abused and 2 fresh out the packet), and 2 x Teensy 3.5 (1 abused and 1 fresh out the packet). I measured the current consumption from a CR2032 battery connected to VBAT through a 220R resistor, measured the mV across the resistor, then calculated current consumption using I = V/R.

Teensy 3.5 current consumption when Teensy off = 0.9 - 1.0 uA. Current consumption when Teensy powered on = 0.5 uA.
Teensy 4.1 current consumption when Teensy off = 84 - 96 uA. Current consumption when Teensy powered on = 0 uA.

I also noticed that with the Teensy 4.1 there was a small voltage on VIN when VBAT was connected. With no external connection to VIN, VIN = 0.28-0.38 V when VBAT was connected to the CR2032. For the same test but with the Teensy 3.5, VIN was 5.2 mV and dropping. I didn't wait for it but looked to me like it was approaching zero.

For my project unfortunately this Teensy 4.1 current usage from the CR2032 battery is unacceptable (dropping to 2 V in ~100 days). Worse is VIN being powered while VBAT is connected, because I have other things attached to VIN in my circuit that will happily eat that ~0.35V and use up the battery faster. I wonder if this is why there seems to be such a variation in reported battery life?

I haven't thought about what I'm going to do about this in detail, but I'm thinking of potentially using an external RTC module, or supplying VBATT using my main battery (10X the capacity), or seeing if I can add a diode or something to VIN to make sure it doesn't back power other parts of the circuit (damage limitation), or having a look do see if there is some sort of software fix (doubt this one). Probably leaning towards an external RTC module so I can completely remove the VBAT from the Teensy system, which seems the brute force way of making this work.

If there are another ideas would very much appreciate them. It's a bit of a pain to change my system design from Teensy 3.5 to Teensy 4.1. Otherwise I am a total Teensy fanboy.

PS. this is my first post. If I have replied in an incorrect way I apologise!


UPDATE.
I added a load to between VIN and GND (a 100R resistor, then separately a 10k resistor) with VBAT connected to a CR2032, and it did not affect the battery current consumption. So I guess the fact that VIN goes to 0.35V doesn't really matter for me. One less thing to worry about.
 
Last edited:
I use RV-3028-C7 rtc's.
They have a very low operating current of 45nA with an accuracy of 1ppm.
They also have trickle charge capability so with a rechargeable cell you never need worry about battery replacement.
You can find information here.

They will even send you samples and an application board free of charge.

I have embedded them in my PCBs and the component cost with a few needed Rs and Cs is approximately £2.

Those prices are from JLCPCB using them for SMT assembley.

My PCBs with places for a Teensy (28 pin), ESP32C3, thermistor and battery power level detect comes in at about £7 (without Teensy and ESP32C3).

Pimoroni do an RV3028 board for £12.90, so you can see I am getting my RV-3028-C7 for nothing.
 
Yea, if you go for the samples it takes 2-3 weeks to arrive.
t least to the UK.
I am not sure where you are located, but I assume the correct side of the Atlantic judging by the time of day that you are posting.
 
This is all great stuff!
For my current go-around, I’m using the Teensy4.1 for all it’s worth (including rtc and push-button on-off) and I’ve switched to a CR 2450 battery to extend the inevitable battery drain on VBAT. And I’m considering how to make in-the-field battery changes easier.
Next revision may well move these two functions off the Teensy.
 
This is all great stuff!
For my current go-around, I’m using the Teensy4.1 for all it’s worth (including rtc and push-button on-off) and I’ve switched to a CR 2450 battery to extend the inevitable battery drain on VBAT. And I’m considering how to make in-the-field battery changes easier.
Next revision may well move these two functions off the Teensy.

I've just had another look at the "3028" Application Manual.
An example circuit below can be used as a system on/off switch
rtc1.jpg
That is without battery back-up, below is a circuit with Rechargeable back-up.
In this case NOT infield battery replacement required!
rtc2.jpg

I am using it without battery backup as I am using a large primary battery (18650) with mains supply/charging.
I have just made my first SMT PCB (using JLCPCB) and to my surprise it worked first time (incorporating RV-3028-c7) with no problems.
Well, my only problem was to space all the components far further apart than needs be.
 
@BriComp, I reviewed that data sheet (whew!)
I think the only I2C commands I need to figure out are:
- how to set and read the unix time
- disable the CLKOUT

Diagram 7.2 looks like a coin cell method to maintain RTC
Diagram 7.3 if ( want to investigate a rechargeable coin cell replacement)
Diagram 7.4 seems to add push-button On/Off with some added MOSFETs. I have a similar circuit that I could use for that.

This seems like a good choice. I see two flavors of the RV-3028-C7 on JLCPCB.com/parts. Looks like different packages. Similar price.

So, did you get this working for RTC and for On-Off button?

Thanks for this!
 
No just RTC, that was all I needed.

I have an idea for a product which I will pr you about.

JLCPCB have two items the vanila vaiety and the Auto quality variety. I chose the latter because it was cheaper (quantity pricing I guess) and had better specs.
I have to take my wife to hospital for a checkup but will explain Unix time and software when I get back.
 
I've just had another look at the "3028" Application Manual.
An example circuit below can be used as a system on/off switch
View attachment 32101
That is without battery back-up, below is a circuit with Rechargeable back-up.
In this case NOT infield battery replacement required!
View attachment 32100

I am using it without battery backup as I am using a large primary battery (18650) with mains supply/charging.
I have just made my first SMT PCB (using JLCPCB) and to my surprise it worked first time (incorporating RV-3028-c7) with no problems.
Well, my only problem was to space all the components far further apart than needs be.

Here is a sketch showing how to set-up and read RV-3028-C7.
Code:
// Developed from Arduino DS3232RTC Library by Jack Christensen
// https://github.com/JChristensen/DS3232RTC
// Copyright (C) 2018 by Jack Christensen and licensed under
// GNU GPL v3.0, https://www.gnu.org/licenses/gpl.html
// and Robert E Bridges (C) 2021
// Example sketch to display the date and time from a RV-30280-C7
// RTC every second. 
//
// Set the date and time by entering the following on the Arduino
// serial monitor:
//  year,month,day,hour,minute,second,
//
// Where
//  year can be two or four digits,
//  month is 1-12,
//  day is 1-31,
//  hour is 0-23, and
//  minute and second are 0-59.
//  20,10,26,19,09,00
// Entering the final comma delimiter (after "second") will avoid a
// one-second timeout and will allow the RTC to be set more accurately.
//
// No validity checking is done, invalid values or incomplete syntax
// in the input will result in an incorrect RTC setting.
//
// Robert Bridges 11Jun2021     Jack Christensen 08Aug2013

#include <Arduino.h>
#include <TimeLib.h>        // https://github.com/PaulStoffregen/Time
#include <RV-3028-C7.h>     // https://github.com/constiko/RV-3028_C7-Arduino_Library
#include <Streaming.h>      // http://arduiniana.org/libraries/streaming/

RV3028 rtc;

static time_t getUnixTime() {return rtc.getUNIX();}
//static uint32_t getUnixTime() { return rtc.getUNIX(); }

void setup()
{
    Serial.begin(115200);
    while (!Serial);

    Wire.begin();
    if (rtc.begin() == false) {
       Serial.println("Something went wrong, check wiring");
       while (1);
    }
    else
        Serial.println("RTC online!");
//    rtc.enableTrickleCharge(TCR_3K);  --- I don't use trickle charge
    rtc.disableTrickleCharge();
    delay(1000);

    // setSyncProvider() causes the Time library to synchronize with the
    // external RTC by calling getUnixTime() every five minutes by default.
    setSyncProvider( getUnixTime );
    Serial.println("Just set up synch provider ");
    Serial << F("RTC Sync");
    if (timeStatus() != timeSet) Serial << F(" FAIL!");
    Serial << endl;
    delay(2000);
}

void loop()
{
    static time_t tLast;
    time_t t;
    tmElements_t tm;

    // check for input to set the RTC, minimum length is 12, i.e. yy,m,d,h,m,s
    if (Serial.available() >= 12) {
        // note that the tmElements_t Year member is an offset from 1970,
        // but the RTC wants the last two digits of the calendar year.
        // use the convenience macros from the Time Library to do the conversions.
        int y = Serial.parseInt();
        if (y >= 100 && y < 1000)
            Serial << F("Error: Year must be two digits or four digits!") << endl;
        else {
            if (y >= 1000)
                tm.Year = CalendarYrToTm(y);
            else    // (y < 100)
                tm.Year = y2kYearToTm(y);
            tm.Month = Serial.parseInt();
            tm.Day = Serial.parseInt();
            tm.Hour = Serial.parseInt();
            tm.Minute = Serial.parseInt();
            tm.Second = Serial.parseInt();
            t = makeTime(tm);
            rtc.setUNIX(t);                                                                                 // Set rtc UNIX time
            rtc.setTime(tm.Second, tm.Minute, tm.Hour, dayOfWeek(t)-1, tm.Day, tm.Month, tm.Year+1970);     // Set rtc Time
            setTime(t);                                                                                     // Set Teensy time
            Serial << F("RTC set to: ");
            printTeensyDateTime(t);
            PrintRtcDateTime();
            PrintUnixTime();
            Serial << endl;
            // dump any extraneous input
            while (Serial.available() > 0) Serial.read();
            delay(5000);
        }
    }

    t = now();      //Get's Teensy Time

    if (t != tLast) {
        tLast = t;
        printTeensyDateTime(t);
        PrintRtcDateTime();
        PrintUnixTime();
        Serial.println();
    }
}

void PrintUnixTime() {
    Serial.print("  Unix Time : ");
    Serial.print(rtc.getUNIX());
}

void PrintRtcDateTime() {
    if (rtc.updateTime() == false) //Updates the time variables from RTC
    {
        Serial.print("RTC failed to update");
    }
    else {
        String currentTime = rtc.stringTimeStamp();
        Serial.print("  RTC: ");  Serial.print(currentTime); // +"     \'s\' = set time");
    }

}

// print date and time to Serial
void printTeensyDateTime(time_t t)
{
    Serial.print("Teensy: ");
    printDate(t);
    Serial << ' ';
    printTime(t);
}

// print time to Serial
void printTime(time_t t)
{
    printI00(hour(t), ':');
    printI00(minute(t), ':');
    printI00(second(t), ' ');
}

// print date to Serial
void printDate(time_t t)
{
    printI00(day(t), 0);
    Serial << monthShortStr(month(t)) << _DEC(year(t));
}

// Print an integer in "00" format (with leading zero),
// followed by a delimiter character to Serial.
// Input value assumed to be between 0 and 99.
void printI00(int val, char delim)
{
    if (val < 10) Serial << '0';
    Serial << _DEC(val);
    if (delim > 0) Serial << delim;
    return;
}
 
More on this problem, I'm running a T4.1 with a largish 3.6V lithium battery into the Vbat pin. I was surprised to see an immediate voltage drop on the battery when turning on the 5V power, and corresponding battery voltage increase with the power off.
Current meter confirms this: Power on the Teensy draws >170uA from the battery through Vbat, and ~33 uA when the power is off. This isn't a viable RTC unless you use a rechargable battery and charger and expect to only ride over short power outs.

Might be defragster is correct and some mode switch is needed to turn off the battery consumption when running and reduce it when off. The manual (i.MX RT1060 Processor Reference Manual, Rev. 3, page 996 suggests maybe one should use SNVS low power mode, not IDLE or SUSPEND. "see the application note AN12085: How to use i.MX RT Low Power Feature." Setting SNVS low power mode apparently shuts off most things but not all (GPIO and RTC wakeup). Have to try it but am hoping someone has the secret sauce already tested.
 
One thing I notice is that the T4.1 schematic shows two Shottkey diodes to supply the standby power, and if the 5V power in is on, this will pick up the current if the battery voltage is below ~3.1V. So, if I put a silicon diode voltage drop (1N4007) in series with my battery, what happens? Bingo, the power ON current drops to ~3uA, and the OFF current is 31 uA. SO! The T4.1 circuit can't use a Lithium battery properly for RTC backup. You need to loose a bit of voltage. I expect this explains quite a bit of the battery loss others have mentioned here.
 
More on getting the standby (xtal RTC only) current down, and a question (anybody listening to this thread? :)

Currently I'm using the same large 3.6V lithium (Tadrian TL-4902 non-rechargeable) battery, but with two silicon diode drops in series (MMBD4148SE dual diode). This drops the ON current to zero, and the off current is 26.5 uA. That leaves lots of voltage margin to keep the clock running to the end of the battery life. But, that's far fewer years than I'd like, so, I'm checking out the various shutdown/ standby modes to get lower current.

I find setting SNVS mode halves the standby current to 13.3uA from 26.1 uA !
Only problem: T4.1 does not wake up on power-up unless you pull it from all power sources, such as the standby battery.
Anyone know the proper way to put a Teensy 4.1 into this mode and get it out on power-up? (Or the truly lowest current xtal RTC mode that can wake reliably?)

Setting "SUSPEND" in PMU_MISC0 as the IMXRT1060RM manual suggests, does nothing.
(two code examples below)

Code:
void setSNVSmode()
{
  //"To enter SNVS mode, set SNVS_LPCR[TOP] to 1."
  SNVS_LPCR |= SNVS_LPCR_TOP;

  // HALVES STANDBY CURRENT! BUT KILLS FUNCTION AND DOES NOT WAKE UP ON POWER-UP
  // OR BUTTON PRESS OR QUICK BATTERY DISCONECT. T4.1 MUST BE PULLED AND RE-INSERTED.
}

void setSuspendMode()
{
  //Configure the analog behavior in stop mode:
  // register constants and macros are from imxrt.h in:
  //   C:\Program Files (x86)\arduino-1.8.19\hardware\teensy\avr\cores\teensy4
  uint32_t cleared = PMU_MISC0 & ~(PMU_MISC0_STOP_MODE_CONFIG(3));

  PMU_MISC0 = cleared | PMU_MISC0_STOP_MODE_CONFIG(0); //n=0-3
  //0 SUSPEND (DSM) — All analog except rtc powered down on stop mode assertion.
  //1 STANDBY — Analog regulators are ON.
  //2 STOP (lower power) — Analog regulators are ON.
  //3 STOP (very lower power) — Analog regulators are OFF.

  //NO DIFFERENCE IN STANDBY CURRENT WITH ANY OF THE FOUR MODES.
}
 
Last edited:
Back
Top