2
\$\begingroup\$

I have a design question:

  1. How to safely turn off a controller IC's (CC2533, RTC clock) while other (eg. Atmega8) are running ? Basically to program the atmega without pulling it out of PCB.

  2. Is there any harm done if VCC is removed to a particular chip say DS1307 RTC when its I2C bus is still powered ?

\$\endgroup\$
2
\$\begingroup\$

For ISP (In-System Programming) of ATMega8s through it's SPI like low voltage programming, you would use series resistors on the SPI lines, if you are using them at all for anything else. The series resistors will allow anything connected directly to the pins to overpower anything on the other side of the resistors. In this case, the ISP programmer will have priority to rewrite the AVR without being affected by any communications from the other side.

enter image description here

This is a common question: SPI device prevents ISP programming

As for the DS1307, it depends on if it is being used with a battery/power source on VBat. From the datasheet:

When VCC falls below 1.25 x VBAT, the device terminates an access in progress and resets the device address counter. Inputs to the device will not be recognized at this time to prevent erroneous data from being written to the device from an out-of-tolerance system. When VCC falls below VBAT, the device switches into a low- current battery-backup mode. Upon power-up, the device switches from battery to VCC when VCC is greater than VBAT +0.2V and recognizes inputs when VCC is greater than 1.25 x VBAT.

VBat must be between 2v and 3.5v, or tied to ground if not needed. If there is a battery, removing power from VCC but not the i2c lines should place the device in timekeeping mode only. i2c communication would be ignored. If there is no battery (and VBat tied to ground), it is unknown how the DS1307 will act. It could pull full power from the i2c lines, through clamp diodes, to power the DS1307 in full function mode. It might pull enough to place it into time keeping mode only. It might go into an undefined state. Or it might not pull power at all.

At best, the RTC will keep time without fail. Or you might have to reprogram it. At worst, you could cause damage to the device and have to replace it. Considering the cheapness of the DS1307, you could experiment to see.

\$\endgroup\$
4
  • \$\begingroup\$ Thank you for detailed answer, My first question is answered perfectly. My concerns are a little more generic as to how to avoid this situation (2) for any given device when its vcc is powered off but some pins still have power. do you have a generic solution to my second question? \$\endgroup\$
    – srinathhs
    Aug 27 '13 at 13:28
  • 1
    \$\begingroup\$ @srinathhs there is no generic solution. Some devices will stay off if VCC is removed but power to gpio are not, some will turn on, and some will fry the ports. The only solution is for circuits where you have complete control of creation of the board. Avoid open collector systems, or pins tied directly to vcc. Stick to devices that have active reset lines so you can control them if needed. Or have all of a circuit or part of a circuit manageable by a regulator with a reset/enable pin so that when you turn it off, both VCC and it's gpio pins loose power, not just it's vcc pin. \$\endgroup\$
    – Passerby
    Aug 27 '13 at 15:09
  • \$\begingroup\$ I do have the control to design the entire board. Can you point me to the regulator you are referring to ? (as an example) I will search from there. \$\endgroup\$
    – srinathhs
    Aug 27 '13 at 17:04
  • \$\begingroup\$ @srinathhs literally any regulator with an enable or shutdown pin. The TPS732xx is a cap-less 250mA LDO with an enable pin for example ti.com/lit/ds/symlink/tps73201.pdf \$\endgroup\$
    – Passerby
    Aug 27 '13 at 23:18
0
\$\begingroup\$

With regards to your first question, many ICs (including the CC2533) have a reset line that can be asserted to do exactly what you describe. To "turn off" the chip, you could simply hold its reset pin in the reset state (in the case of CC2533 RESET_N should be low). This should prevent any accidental interactions with the given IC while reprogramming another. Some devices may not cope well with sudden power loss, but such would likely be noted prominently in the electrical characteristics section of the relevant datasheet.

With regard to your second question, and in general, refer to your device's datasheet.

\$\endgroup\$
6
  • 1
    \$\begingroup\$ Actually, the ds1307 will pull power from the i2c lines. \$\endgroup\$
    – Passerby
    Aug 26 '13 at 21:32
  • \$\begingroup\$ What @Passerby said. If the I2C lines are still pulled high, you will wind up powering the IC through the protection diodes on the input line. \$\endgroup\$ Aug 27 '13 at 4:30
  • \$\begingroup\$ I haven't worked with a DS1307 myself. Can you point out where that is implied in the datasheet (or possibly the errata)? Or is this something left for each engineer to discover individually? \$\endgroup\$ Aug 27 '13 at 12:40
  • \$\begingroup\$ @multipleinterfaces using internal clamping diodes to power a device is an abuse of clamping diodes, sometimes done intentionally in hobbyist projects. Other times, it is a problem that this very situation (removing power from the vcc pin only) creates. Most circuits are not designed to drive ic pins when the ic's power is removed (i.e, non standard operation). As for datasheet, I have given some info in my answer. Since the DS1307 has a slightly more complex power setup (vcc and vbat) than other devices, it has a more complicated set of possibilities. \$\endgroup\$
    – Passerby
    Aug 27 '13 at 15:13
  • \$\begingroup\$ @multipleinterfaces for further note, most ic datasheets will show in their absolute maximum section that voltage on any pin should be at most vcc + 0.3~0.7v. So giving 3v or 5v on a ic with vcc at 0v (or floating) will, as far as the manufacturer is concern, break the thing. \$\endgroup\$
    – Passerby
    Aug 27 '13 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.