Shop OBEX P1 Docs P2 Docs Learn Events
DS1307 Real Time Clock SWQ/OUT current draw when using Vbat and a pullup — Parallax Forums

DS1307 Real Time Clock SWQ/OUT current draw when using Vbat and a pullup

ZootZoot Posts: 2,227
edited 2007-01-15 04:43 in General Discussion
Somebody said...
PIN 7 SWQ/OUT
Square Wave/Output Driver. When enabled, the SQWE bit set to 1, the SQW/OUT pin
outputs one of four square-wave frequencies (1Hz, 4kHz, 8kHz, 32kHz). The SQW/OUT
pin is open drain and requires an external pullup resistor. SQW/OUT operates with either
VCC or VBAT applied.

I'm using the DS1307 on a project (it's an I2C RTC similar to the DS1302). I have no problem using the RTC or with my code, but I was in the process of hooking up the SQW/OUT pin and had a question.

I was going to use this pin running at 1hz with a poll latched pin on my Stamp, along with the required pullup. BUT if the SQW/OUT pin runs on Vbat as well as Vcc, then wouldn't I be drawing current from my RTC backup battery over and above the needs of the RTC/NVRAM itself? I was going to use the SQW for a "seconds" watchdog timer, but not at the expense of running down the backup battery faster.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST

Comments

  • FranklinFranklin Posts: 4,747
    edited 2007-01-14 02:30
    Somebody said...
    ·either VCC or VBAT applied.
    I think it is either not both.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • ZootZoot Posts: 2,227
    edited 2007-01-14 15:35
    It puts out a square wave (if enabled) when running from regular Vcc power or, if you fall below their voltage formula, from Vbat (a lithium backup cell). Since there is a pullup resistor on the SQW pin, should I figure that on the low going part of the sqw I'll be drawing a tiny bit of current from the battery, even if the Stamp and the other systems on the 'bot are powered down?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2007-01-15 03:39
    If the pullup is connected to the same Vdd as the Stamp, the current will come from the Vdd supply, and not from the backup. It does not have to be much current. I use a 1 megaohm or 2.2 megaohm resistor, and the transition 1->0 is very sharp as the transistor turns on. So if you want to hook it up to the Vbat for some reason, you could comfortably make the pullup resistor 3.3 megaohms and only lose 1/2 microamp on the average.

    Do you really mean the Stamp is powered down, or only that it is in a SLEEP or POLLWAIT state?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • ZootZoot Posts: 2,227
    edited 2007-01-15 04:43
    Powered down. As in power switch to the main battery is off (this is a 'bot).

    And yes, the pullup is to the main electronics (and Stamp) Vdd. Duh -- with power off at Vdd I wouldn't see a current draw from the RTC backup battery.
    I was using a 20k pullup but it sounds like I can go much higher to cut down on current draw regardless. Thanks!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST
Sign In or Register to comment.