Few questions about I2C and microsd cards

Hi,

A FEW QUESTIONS :slight_smile:

I'm powering a DS1337 RTC with a small 3.7v lipo for time keeping when the rest of my device is off.
My device is run by an atmega328p 8Mhz at 3.3 volts.

The max voltage of the lipo powering the RTC is 4.1v. Does this mean that this is the max voltage going down the I2C lines to the atmega? If the atmega is running at 3.3v can it take a higher voltage on the I2C lines?


What are your views about using the card detect pins on a microsd socket as a power switch?


I am using a microsd card socket as a means of programming my device. I am using pin 8 for the reset, which as a bonus pulls that pin of the sd card up to 3.3v then the card is inserted.

I do not have anything connected to pin 1. I was wondering if I could use it as a means of charging the 3.7v lipo on the device when the sd card was not inserted? If I connected it directly to the battery there would be a max of 4.1v on pin 1 of the sd card when it was inserted, which I don't think would be good for the card. Is that correct?

Would a locking diode resolve this? Will the voltage drop across the diode allow me to charge the lipo fully?

Thanks very much,

Damien.

Run the I2C at 3.3v (pull up to 3.3) - the RTC will probably be able to handle that with no problem (check the datasheet to be sure that 3.3v is high enough to count as a high - if it's not, you need a level shifter).

Per the datasheet, you cannot exceed Vcc+0.5v on any pin - see the diagram of the IO pins as well, they're clamped between Vcc and Gnd by the on-chip protection diodes.

SD cards really don't like overvoltage, 4.1v would trash it. Is there a reason you can't use another connector for charging? Maybe a mini/micro USB port? Those are the standard charging connector in these modern times.

DrAzzy:
SD cards really don't like overvoltage, 4.1v would trash it. Is there a reason you can't use another connector for charging? Maybe a mini/micro USB port? Those are the standard charging connector in these modern times.

The device is a small data logger not much bigger than a microSD card. I am trying to kill many birds with one stone :slight_smile:

Yeah, I don't think using the SD card as a charging port is wise.

Is the LiPo battery powering the RTC only, or everything?

DrAzzy:
Yeah, I don't think using the SD card as a charging port is wise.

Is the LiPo battery powering the RTC only, or everything?

I have decided to run the RTC through the 3.3v voltage regulator. The voltage regulator only uses a few Nano amps. Both devices will be permanently connected to the lipo. Hoping to switch the rest of the device on with the card detect pins of the microsd socket. The battery will then run everything.

At the minute there is nothing connected to pin 1 of the socket and everything is working ok. Would a diode not allow me to charge the lipo through this pin, but not allow any voltage back through it when the sd card is attached?

Cheers

That might work - try it, but with care (ie, test it with a disposable micro SD card and fully charged (ie worst case) battery, and measure the voltage on that pin with the card in, make sure it's not something outside the allowable range for the uSD card) - there will be a bit of reverse leakage through the diode, and normally I wouldn't be the least bit concerned with that (a protection diode will easily win), but it's a microSD card, and those are notoriously fragile electronically, so I would take particular care. .

Thanks I'll give it at test. If there is some leakage voltage to the sd card that might not be a bad thing. Apparently its good practice to pull this pin up to 3.3v.

Do you have any particular diode in mind? or will I just start testing?

Cheers

Hi,

Its been a while since I was on this question, but I was wondering if I could use a P-channel mosfet instead of a diode.

I'm thinking connect the source to pin one of sdcard socket.
Connect gate to ground
and connect drain to battery positive.

So when power is connected to pin one of the sdcard socket from the charger, the voltage difference between source and gate will turn mosfet on and allow power through drain to battery. Then when the sd card is inserted there will be now power at the source, which should turn the mosfet off.

Is any of that correct, or have I totally grasped mosfets wrong :slight_smile: ?

Thanks,

Damien

Seedler:
The voltage regulator only uses a few Nano amps. Both devices will be permanently connected to the lipo. Hoping to switch the rest of the device on with the

There are some 3V3 regulators that in standby mode are down to a few uA, but which one goes even lower into Nano amps ?

srnet:
There are some 3V3 regulators that in standby mode are down to a few uA, but which one goes even lower into Nano amps ?

Sorry, I thought uA meant Nano amps :).

Does anyone have an idea about the mosfet?

Cheers.