Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: Voltage limit on Teensy 3.6 for RTC Vbat?

  1. #1
    Senior Member
    Join Date
    Oct 2015
    Location
    Vermont, USA
    Posts
    148

    Voltage limit on Teensy 3.6 for RTC Vbat?

    Hi,

    I'm interested in using the RTC functionality that is (apparently) part of the Teensy 3.6. First, is there any documentation that speaks to how to do this? Is there any "Getting Started with RTC on the Teensy" kind of document or link?

    If not, my searches on this forum seem to suggest that I just need to add a coin cell to the VBat terminal in the central area of the Teensy 3.6 board. Is this really all that I need to do? That's pretty easy!

    My question is whether I'm only limited to a coin cell. What voltages will this pin tolerate? Currently, I've re-wired my Teensy to be powered by an Adafruit LiPo (https://www.adafruit.com/product/1578). I could easily shoot a wire over to the RTC Vbat pin as well. But, the voltage of this battery ranges up to 4.2V. Could 4.2V damage the Teensy?

    Clearly, I'm a total newbie when it comes to RTC. I would appreciate any guidance that you can provide.

    Thanks,

    Chip

  2. #2
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    2,575
    How to use it is documented here:


    As it says on the page, the Teensy 3.5/3.6 chips already have the crystal installed.

    As far as I know, powering Vbat with more than 3v (or 3.6v?) would damge it. The first generation of Adafruit Teensy Feather adapter tied the Vbat pin to the lipo voltage, and they needed to issue a redesign. Here is a thread over at the Adafruit forum about this (this is where I learned about the voltage issue with Vbat):


    Note, the RTC in the Teensy is not temperature corrected (like a DS3231 is), so it may drift over time.

    This thread talks about how the RTC is set up:

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    16,310
    Use the Time library. In Arduino, click File > Examples > Time > TimeTeensy3.

  4. #4
    Senior Member
    Join Date
    Oct 2015
    Location
    Vermont, USA
    Posts
    148
    Thanks for the the software library.

    I looked up the datasheet for the MK66FX1MOVMD18 and saw that the RTC VBat must be between 1.71V and 3.6V (firm do-not-exceed limits are -0.3 to 3.8V). So, as y'all said, putting raw LiPo voltage on this pin is not acceptable. But, I don't feel like consuming the space in my widget for a coin cell, either.

    I'm thinking about still using the LiPo, but reducing the voltage through a diode or voltage divider. I'd need to know the current draw of the RTC to decide if these are feasible approaches. Continuing to look at the datasheet, I see numbers like 432-810nA (Table 6), but that might be current drawn from the main power supply for different RTC configurations. Being inexperienced, it's unclear to me. Turning to the "K66 Sub-Family Reference Manual" instead of the datasheet, I see more talk of the RTC, but no current draw numbers.

    Still, if a coin cell is to work for the RTC, it must be a pretty small current draw. If I were to assume that I use a voltage divider that is 50K high-side (R1) and 150K low-side (R2), I'd get this kind of response:

    Vbat = (V_LiPo - I_Vbat * R1) / (1 + R1/R2)

    with results being:


    Code:
    V LiPo    VBat, No I_VBat        I_VBat that pulls VBat down to 1.71V
    ------    ------------------     -----------------------------------------
    4.2V      3.2V (<3.6, Good!)     0.038 mA
    3.3V      2.5V (>1.7, Good!)     0.020 mA
    So, as long as the current into the VBat pin is < 0.02 mA, I can perhaps use a 50K/150K voltage divider from my LiPo to supply my Vbat RTC. Maybe I'll hack it up tonight!

    Chip

  5. #5
    Senior Member
    Join Date
    Oct 2015
    Location
    Vermont, USA
    Posts
    148
    I tried the resistor divider and I tried the Teensy time library. While my resistor divider is ugly (see below), it works great!

    Click image for larger version. 

Name:	Picture1.jpg 
Views:	16 
Size:	89.1 KB 
ID:	12293

    As an aside, I actually used 50K / 125K for my resistor divider as that ratio would also protect the system in case 5V happened to appear on my LiPo terminals.

    The RTC is pretty cool! Thanks for all the effort that went into the Time library to make it easy for me!

    Chip
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	IMG_8430.JPG 
Views:	11 
Size:	142.3 KB 
ID:	12292  

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •