We are using an MCF52259 and want to wire the RTC battery to an ADC pin to read its state of charge, but obviously with battery life being finite we don't want to draw too much current from it.
Does anyone know, or is it in a data sheet somewhere, what the impedance of the ADC pins is both when the micro is powered up and when it's powered down? I have looked in the micro reference manual but there's no data on this.
We are going to measure it with a DMM as well, but obviously it's nice to have some official numbers to go on.
已解决! 转到解答。
MCF52259 Coldfire Microcontroller DataSheet
2.1 Maximum Ratings
Table 4. Absolute Maximum Ratings
Digital Input Voltage -0.3 to 4.0 BUT
(4) All functional non-supply pins are internally clamped to Vss and Vdd.
From that I'd say that with the CPU power off the pin impedance is going to be one diode drop to ground.
So you either need a FET disconnecting the battery from the ADC input that is only turned on (from a GPIO) when you want to read the battery *OR* a very large resistor (100k or so) from the battery to the ADC pin. Select the resistor to be as high as possible, where the limiting factor is the error caused by the pin injection current.
Make sure you have a capacitor on that pin to filter it, and then work out the RC time it needs to be enabled to charge up, and the time it will hold when you start sampling and the ADC starts pulling current from it.
So read Section "2.15 Analog to Digital Converter", read Figure 14, then note where it also says:
"One aspect of this circuit is that there is an on-going input current, which is a function of the analog input voltage, VREF and the ADC clock frequency."
It says the equivalent input impedance is (1 / ((ADC Clock Rate) * (1.4*10^-12)))
MCF52259 Coldfire Microcontroller DataSheet
2.1 Maximum Ratings
Table 4. Absolute Maximum Ratings
Digital Input Voltage -0.3 to 4.0 BUT
(4) All functional non-supply pins are internally clamped to Vss and Vdd.
From that I'd say that with the CPU power off the pin impedance is going to be one diode drop to ground.
So you either need a FET disconnecting the battery from the ADC input that is only turned on (from a GPIO) when you want to read the battery *OR* a very large resistor (100k or so) from the battery to the ADC pin. Select the resistor to be as high as possible, where the limiting factor is the error caused by the pin injection current.
Make sure you have a capacitor on that pin to filter it, and then work out the RC time it needs to be enabled to charge up, and the time it will hold when you start sampling and the ADC starts pulling current from it.
So read Section "2.15 Analog to Digital Converter", read Figure 14, then note where it also says:
"One aspect of this circuit is that there is an on-going input current, which is a function of the analog input voltage, VREF and the ADC clock frequency."
It says the equivalent input impedance is (1 / ((ADC Clock Rate) * (1.4*10^-12)))
Well a bit of poking with the DMM has revealed they're in the region of 14-16 MOhms, or at least the micros we have here are. The issue is really knowing what the official answer / range of answers is as we're taking a bit of a gamble with battery life otherwise. Hopefully it won't prove too critical in our app.
FridgeFreezer wrote:Well a bit of poking with the DMM has revealed they're in the region of 14-16 MOhms,
At what volatage though? The DMM will give you the resistance of a resistor, but the micro is a bit more complicated than that.
Specifically:
> (4) All functional non-supply pins are internally clamped to Vss and Vdd.
That means that they might have a high impedance at less than 0.7V, but over that they're a dead short to VDD.
What you're really interested in is the current draw from the battery through that pin - so use the DMM to measure that current.
You should also measure the power-off voltage on VDD when you're doing this - VDD may be getting partially powered from the battery via the ADC pin and the clamp diodes.