Current leakage on multiprocessor system.

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

I want to use a spare tiny25 and watch crystal as a real time clock over I2C for a data logging application.

The master processor is a mega168 connected to an SD card, the clock is for keeping track of the file creation time.

Another processor also connects to the I2C and handles the User interface display switches and IR remote input.

I would want the clock portion to be battery backed up which wakes up once a second and increments a counter.

Question is, that if I power the tiny25 from a coin cell, how do I keep current from leaking into the mega168 and powering it and the User interface controller?

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

Why not use a real RTC chip which does everything for you and keeps the time VERY ACCURATELY? :) ie DS3231

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

jporter wrote:
Question is, that if I power the tiny25 from a coin cell, how do I keep current from leaking into the mega168 and powering it and the User interface controller?
A level-translating buffer (I2C compatible) or an I2C repeater (level translating); try
TI Home > Interface > I2C > I2C Hub, Buffer, Repeater
TXS0102 (2-Bit Bidirectional Voltage-Level Translator for Open-Drain Application)

"Dare to be naïve." - Buckminster Fuller

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

jporter wrote:
... real time clock ...
A number of MCUs have a battery-backed RTC function built-in. Would an XMEGA256A3B(U) work?
Edit: added battery-backed.

"Dare to be naïve." - Buckminster Fuller

Last Edited: Fri. Jun 8, 2012 - 08:33 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This can often be solved by using diodes, but I don't know exactly how your system is interconnected.

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

Since I2C is open-collector bus, just connect the pull-ups to the supply voltage that gets powered down. The Tiny25 will never force the I2C pins high, if it works like normal I2C chips.

Your Tiny25 USI might get confused during power-ups and power-downs, so when you power up, the I2C bus can be in undefined state and must have some kind of reset sequence to get it up and running. For example power can be cut when you are reading from Tiny25 and it will keep waiting for data to be clocked out. Your tiny25 can also monitor if the rest of the power is there or not, or have some timeout system to get over this.

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

jporter wrote:
The master processor is a mega168 ...
Use the mega168's RTC. Power the master MCU from either the power supply or the coin cell via diode OR. When the power supply is off the master MCU will enter the Power Save mode. Master MCU will handle the RTC interrupts then reenter Power Save (shouldn't use too much of the coin cell's charge). This may be Lennart's idea.

"Dare to be naïve." - Buckminster Fuller

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

The ATmega168P in power-save mode (watch crystal running on T2) need about 1µA @ 3V.
The ATtiny25 with a watch crystal as CPU clock need about 40µA.

Peter

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

Perhaps you just need a drip pan?

The largest known prime number: 282589933-1

In my humble opinion, I'm always right. 

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

Quote:
Use the mega168's RTC. Power the master MCU from either the power supply or the coin cell via diode OR. When the power supply is off the master MCU will enter the Power Save mode. Master MCU will handle the RTC interrupts then reenter Power Save (shouldn't use too much of the coin cell's charge). This may be Lennart's idea.

The last sentence surprised me since I have an application that petty much do what you desribe using m644. Except with a Supercap as "coin cell".
Several external chips and pull_up resistors get power from one diode. The other diode only feed m644 Vcc/AVcc and Supercap.
When external power dies a pin sense that and m644 goes to sleep.

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

Lennart wrote:
Except with a Supercap as "coin cell".
Supercaps can be a good choice over batteries for backup applications by Steve Knoth (Linear Technology).

"Dare to be naïve." - Buckminster Fuller

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

danni wrote:
The ATmega168P in power-save mode (watch crystal running on T2) need about 1µA @ 3V.
The ATtiny25 with a watch crystal as CPU clock need about 40µA.

Peter

Thanks for all the information. I think using a spare ATmega88p I have may be better than using one of the tiny25 spares.

I was thinking that the tiny25 also had the RTC mode on the shared XTAL pins. Re reading the data sheet, I see that the tiny25 does not support other than the internal watchdog timer during sleep. So the tiny would have to be running all the time.

Ideally I want to have the system just count seconds or what ever it is that the FAT file system needs to store in the directory field.

The application is a record system for a pipe organ, which already has the information on a rs485 pair. So all I am doing is logging the data to a SD card. I thought about tracking the time interrupt in the main processor. The issue is that I have to use a 16Mhz crystal to get the right timing for the rs486 baud rate. This makes using the internal rc and watch crystal invalid.

The petite fat system I modified for file write, pretty much slams most of the timer resources as I only have something like 20mS to log each frame on the rs485. The other timers are keeping track of the spacing within the frames for playback.

I have a nice old 14 segment VFD with nice large letters, so by going with the mega88p I can basically borrow from the ICE clock on the AdaFruit site.

I had intended to base some of this on a z8water timer project I had archived from cate.com. That project has a better filament circuit.

By moving the IO processes to the mega88p, I can also monitor the power states as well as the VFD.