I would use small MOSFET rather than BJT. Just make sure MOSFET gate is designed to completely turn on with gate voltage of your MCU (2.5V or 3.3V). As long as datasheet gives on-resistance at a voltage that is 2.5V to 3.3V MCU can turn it on (do not look at gate threshold voltage on datasheet since this is voltage that just "barely" turns on MOSFET). Otherwise you will experience same problem as before...MCU output HI is not high enough. Also make sure MOSFET can tolerate at least 12V across source-drain since it needs to block this voltage when it is off.
Use as small MOSFET as possible so MCU can turn it on as fast as possible since power is not a problem here, you do not need large MOSFET.
FOr example, IRLML2502, IRLML2402...any of these will work. You can probably find smaller cheaper transistors to do the job.
You can also just use small BJT with base resistor if you cannot find logic level MOSFET.
yes i got u, b4 i always control low voltage chips by MCU, It's my first time to control a demux with this voltage level. I can program relatively good but hardware it not really my advantage. Thanks for the turtoring..I'm so lazy I should post the pics. yesterday.
yes i got u, b4 i always control low voltage chips by MCU, It's my first time to control a demux with this voltage level. I can program relatively good but hardware it not really my advantage. Thanks for the turtoring..I'm so lazy I should post the pics. yesterday.
The MCU i/o can output voltage as high as 5.7v, if I follow the datasheet, I need to shift from at least 5v to 10v. is that right? it's for the high level, the low level should shift from 0v to 5v
The MCU i/o can output voltage as high as 5.7v, if I follow the datasheet, I need to shift from at least 5v to 10v. is that right? it's for the high level, the low level should shift from 0v to 5v
Low level is fine because any input voltage below LO threshold is understood as LO by demux. LO threshold increase with supply voltage so no problem there since you are always below LO threshold. LO signal from MCU will be read as LO signal by demux.
The problem is the high output voltage because increasing supply voltage increase HI voltage threshold, but input voltage must be higher than threshold to be read as HI.
My pull-up resistor and pull-down transistor is a level shifter and should solve your problem.
One thing you should know about my solution...the level-shifter is actually a level-shifting INVERTER.
So if MCU send LO to level-shifter, level-shifter will send HI to demux. If MCU send HI to level-shifter, level-shifterwill send LO to demux. You can easily deal with this in code.
You know, it's really nice to see a student who actually has done some work and is trying to figure out what's wrong with what they have done and asks a question that can actually be answered rather than asking for a handout.