Tri-State Logic and a propeller input?
computer guy
Posts: 1,113
I am wanting to use the MCP73831 to charge the Li-Po battery running the propeller.
I then want to use the MCP73831's State line to tell the propeller when the battery is charging (so I can display a charging icon on an uOLED display).
The data-sheet for the MCP73831 states that the State line is tri-state logic (VSS-NC-VDD).
It also states that it can be connected to a microcontroller if pulled high (presumably to make it high when in the NC (floating) state.
My question is, what effect will this have on the propeller if the state pin switches between VSS, floating and 5V, and is then connected through a 10K pull-up to 3.3V and then to the propeller chip?
Should I put a 240ohm resistor on the prop pin to protect it from the 5V?
Thanks
I then want to use the MCP73831's State line to tell the propeller when the battery is charging (so I can display a charging icon on an uOLED display).
The data-sheet for the MCP73831 states that the State line is tri-state logic (VSS-NC-VDD).
It also states that it can be connected to a microcontroller if pulled high (presumably to make it high when in the NC (floating) state.
My question is, what effect will this have on the propeller if the state pin switches between VSS, floating and 5V, and is then connected through a 10K pull-up to 3.3V and then to the propeller chip?
Should I put a 240ohm resistor on the prop pin to protect it from the 5V?
Thanks
Comments
There have been lots of discussions about the technicalities of this but it is the universal bidirectional 3.3V to 5V translator, as well as handling all the possibilities of the 9 combinations in that matrix.
So you are very close to the answer - change that 240R to something a bit higher.
Hmm - having said that, there may be those who will chime in to say that 2.7k is better. I guess for a more perfect technical answer - anything in series from 1k to 3.3k ought to work.
The 2.2K resistor is chosen based on Ohm's Law. The Prop I/O pin can handle 0.5mA through the protective diode and 5.0V - (3.3V + 0.6V) = 1.1V. R = E / I = 1.1V / 0.5mA = 2.2K. Since neither resistor values nor power supply voltages are exactly what's expected, you might pick a little higher resistor value, say 2.7K or 3.3K to "play it safe".
I would do this (See below). This will give the Prop a 2.5V signal when the MCP73831 output goes high (5V).
It should not matter if you pull the MCP73831 pin up or down, as long as it is a known state. The shematic below will pull the MCP73831 pin down, so you don't need to add anything else.
Make sure the "GND" connection in the schematic connects to both the Propeller GND and the MCP73831 GND (Vss)
You may need to change the Prop ina[pin] value appropriately.
Andy
The prop have protection diodes that will shunt excessive voltages, so the 10k will keep the didoes from over currents.
So in theory, one resistor is enough.
Ariba (Andy)- I like that code. Pretty sweet. The STATE pin on the MCP73831 is just designed to turn on an LED to indicate the charging state of the battery, so I don't think "Computer Guy" would need to do tri-state sensing, but it is pretty cool.
-Phil
I don't think pulling it low would work, the state pin goes low to indicate charging, high to indicate charged and HiZ to indicate that the supply voltage is below the battery level (or no charge power is connected). With pulling it low, "no power" and "charging" would have the same state. Whereas you want "no power" and "charged" to have the same state.
Thank you all for your input and advice, It's clear to me that there may be many ways of doing this however for this project I have decided to go with Mike Green's approach as it is closest to what I am familiar with. I will use a 100k pull-up to 5V and a 2.7K resistor in series to the prop pin.