|
I bought an MCP73831 battery management CI. The datasheet specifies that it can have the following states for the "STAT1" pin:
Shutdown or no Battery Present: [High Z]
Preconditioning: [L]
Constant-Current Fast Charge [L]
Constant Voltage: [L]
Charge Complete: [H]
Sorry? What's a "High Z" state? I was stuck with this for a while. How do I read that "High Z" status from my microcontroller?
"High Z" means "High impedance" status, but it is easy to understand as a status when the pin is disconnected from the bus, leaving it "floating" (no HIGH, no LOW) to free the bus for other devices.
To read this "High Z" status, we can connect the pin to a voltage divider, as shown in the circuit.
Then, between R1 and R2 will have 2.5V for the "Z Status" (pin floating), and 0V for "Low" status, 5V for "High" status.
Therefore if we pass the voltage to our microcontroller's ADC, we can read the three states easily (the first third in our digital range will be LOW, the second range will be "High Z", and the third will be "High").
In this circuit, "High" and "Low" status are simulated by pressing the logic source button as always, and the "High Z" status is simulated by opening the switch for simulating a "floating" or "high impedance" pin.
All the fancy digital stuff at the right is just pretending to be the microcontroller's ADC.
Now, for my simulated MCP73831 pin, I can read:
Shutdown or no Battery Present: 0
Preconditioning: 1
Constant-Current Fast Charge: 1
Constant Voltage: 1
Charge Complete: 2
|