74HC(T)245 interfacing 5v cifcuits e.g. driving 5v logic level mosfets
Posted: Fri Aug 20, 2021 5:25 pm
recently i messed a bit with 3d printing
the idea is to interface a stm32 board with a ramps style board e.g.
https://reprap.org/wiki/RAMPS_1.4
it turns out getting Marlin to run on stm32 (say f4xx) is 'pretty easy'
viewtopic.php?f=10&t=1213
then i hit a bummer, ramps 1.4 is 5v board, the logic level mosfets that runs the hotend and bed heaters are 5v based
this effectively means stm32 can't drive them directly as the gate voltages is at least some 4.5 volts.
i started looking at simple transistors as 'level shifters'
starting with simple one transistor
http://electronics-diy.com/electronic_s ... hp?id=1012
https://www.baldengineer.com/low-side-v ... witch.html
https://www.baldengineer.com/low-side-v ... ivers#main
then more elaborate circuits
TI has a very nice article/doc
https://www.ti.com/lit/slua618
other examples
https://www.eevblog.com/forum/beginners ... -a-mosfet/
a main problem is the initial 'simple' one transistor design tends to be *inverting*, this is a big danger as the mosfet is turned on when the gpio pin is off or floating. then as more transistors are added, it solves the problem but that it significantly adds more discrete components for driving a single mosfet.
then i looked at uln2003 driving mosfets, that is similar to transistors, saves some discretes, but that it cause inverting outputs.
https://electronics.stackexchange.com/q ... er-uln2003
then i looked at dedicated gate drivers, i stumbled into one during searches
https://www.infineon.com/cms/en/product ... cs/ir2103/
ir2103 is very good. Specifically, these solve a difficult problem for high side n-mosfet in that they require a bootstrp, just to kick it into action.
however, for this purpose it is an overkill and slightly pricy, but they are useful in the relevant context such high power h-bridges, power amp outputs and mains inverters. those are the use cases where such drivers are justified.
then i discovered another problem. as the ramps board runs at 5V VCC, it turns out although the various motor drivers can run off 3v. But if vcc is 5v the vin high levels are above 3.3v, Which means there'd be problem running even the motor drivers at a 5v vcc. and that 5v vcc is shared to the mosfets which requires at least 4.5v to be of any use.
then finally i stumbled into
74HC(T)245
https://www.nexperia.com/products/analo ... CT245.html
this modest chip fits the use case so well, it translates (buffers) 3.3v logic levels to 5v logic levels and should have no problem driving the ramps board.
and being a cmos device, it has complementary push-pull output stages as like all the gpios and it alleviates the problem of driving mosfet high capacitance gates.
https://markobakula.wordpress.com/power ... e-circuit/
and best of all it saved so many discrete components, transistors, resistors and all, reducing the whole circuit design to simply wires. if one stage has an average of say 6-10 (lets take 10) components. for 8 outputs that is 80 discrete components, it is reduced to a single component.
74HC245 is cmos logic levels, i think stm32 can just about barely drive it at 5v vdd, but borderline.
74HCT245 is more appropriate as it has a VIN high of 2v which leaves lots of room for stm32 to turn it on
74HC(T)245 is one good part to keep around. it is so crucial to interfacing between 3v to 5v logic.
the idea is to interface a stm32 board with a ramps style board e.g.
https://reprap.org/wiki/RAMPS_1.4
it turns out getting Marlin to run on stm32 (say f4xx) is 'pretty easy'
viewtopic.php?f=10&t=1213
then i hit a bummer, ramps 1.4 is 5v board, the logic level mosfets that runs the hotend and bed heaters are 5v based
this effectively means stm32 can't drive them directly as the gate voltages is at least some 4.5 volts.
i started looking at simple transistors as 'level shifters'
starting with simple one transistor
http://electronics-diy.com/electronic_s ... hp?id=1012
https://www.baldengineer.com/low-side-v ... witch.html
https://www.baldengineer.com/low-side-v ... ivers#main
then more elaborate circuits
TI has a very nice article/doc
https://www.ti.com/lit/slua618
other examples
https://www.eevblog.com/forum/beginners ... -a-mosfet/
a main problem is the initial 'simple' one transistor design tends to be *inverting*, this is a big danger as the mosfet is turned on when the gpio pin is off or floating. then as more transistors are added, it solves the problem but that it significantly adds more discrete components for driving a single mosfet.
then i looked at uln2003 driving mosfets, that is similar to transistors, saves some discretes, but that it cause inverting outputs.
https://electronics.stackexchange.com/q ... er-uln2003
then i looked at dedicated gate drivers, i stumbled into one during searches
https://www.infineon.com/cms/en/product ... cs/ir2103/
ir2103 is very good. Specifically, these solve a difficult problem for high side n-mosfet in that they require a bootstrp, just to kick it into action.
however, for this purpose it is an overkill and slightly pricy, but they are useful in the relevant context such high power h-bridges, power amp outputs and mains inverters. those are the use cases where such drivers are justified.
then i discovered another problem. as the ramps board runs at 5V VCC, it turns out although the various motor drivers can run off 3v. But if vcc is 5v the vin high levels are above 3.3v, Which means there'd be problem running even the motor drivers at a 5v vcc. and that 5v vcc is shared to the mosfets which requires at least 4.5v to be of any use.
then finally i stumbled into
74HC(T)245
https://www.nexperia.com/products/analo ... CT245.html
this modest chip fits the use case so well, it translates (buffers) 3.3v logic levels to 5v logic levels and should have no problem driving the ramps board.
and being a cmos device, it has complementary push-pull output stages as like all the gpios and it alleviates the problem of driving mosfet high capacitance gates.
https://markobakula.wordpress.com/power ... e-circuit/
and best of all it saved so many discrete components, transistors, resistors and all, reducing the whole circuit design to simply wires. if one stage has an average of say 6-10 (lets take 10) components. for 8 outputs that is 80 discrete components, it is reduced to a single component.
74HC245 is cmos logic levels, i think stm32 can just about barely drive it at 5v vdd, but borderline.
74HCT245 is more appropriate as it has a VIN high of 2v which leaves lots of room for stm32 to turn it on
74HC(T)245 is one good part to keep around. it is so crucial to interfacing between 3v to 5v logic.