74HC(T)245 interfacing 5v cifcuits e.g. driving 5v logic level mosfets

Anything not related to STM32
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: 74HC(T)245 interfacing 5v cifcuits e.g. driving 5v logic level mosfets

Post by ag123 »

i may try this as my 'mosfet driver'

Code: Select all

                      |----+ mosfet gate
3.3v (gpio) +-|<-+-|<-+----4.7k----+5v vcc
this is possibly the 'cheapest' mosfet gate driver :/
otherwise i'd use those 1 bit level shifters

incidentally i found a part called SN74LVC4245A, the pinouts are similar to 74hct245 but different.
this TI part use 2 supply rails, 3.3v and 5v vcc, so it bridges better, but i'd guess there's a slight premium
it is interesting how a 'natural' problem creates biz opportunities. they are certainly pricier than the 'cheap' level shifters
https://www.aliexpress.com/wholesale?ca ... 74LVC4245A
.rpv
Posts: 43
Joined: Wed Dec 18, 2019 10:19 pm

Re: 74HC(T)245 interfacing 5v cifcuits e.g. driving 5v logic level mosfets

Post by .rpv »

One project that I got for about 2 years it's to make a 3d printer controller :lol:

I just collected a few parts but still haven't started yet ;)

74HC125 (quad) (untested)
https://www.aliexpress.com/item/32344341714.html

SN74HC125 (single) (I tested this part and works nice)
https://www.aliexpress.com/item/32790972287.html

UCC27517 (mosfet driver) (untested) (when I order this part cost me 2.7usd)
https://www.aliexpress.com/item/4001029260333.html

UCC27324 (dual mosfet driver) (untested)
https://www.aliexpress.com/item/4001034201225.html

SN74LVC1G17 (schmitt trigger) (I tested this part and works nice)
https://www.aliexpress.com/item/32977362071.html

For what I find, marlin uses <10hz PWM for the bed so you can use any of those connected to 5v, the mosfet drivers can be connected directly to 12v (but not suitable for 24v).

I collected a few mosfets too: AON6522, AON6560, AON6504, AON7318.
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: 74HC(T)245 interfacing 5v cifcuits e.g. driving 5v logic level mosfets

Post by ag123 »

@.rpv thanks for sharing !

i've decided to take the 'shortcut' and just make do with 'conventional' 'ramps' board, apparently this is pretty much a 'standard model' or 'stereotype' of the '3d printer driver' stage (or the 'driving' components).

i'd likely try to dig out a piece of 74HCT245 that i stuffed away deep in the parts box, and maybe solder it to an 'adapter board', that'd be my 'mosfet driver'. failing which i'd likely get those SN74HC125 as only 3 pieces are needed to interface the ramps board mosfets.

i think one of those things that seemed missing is to make a 'ramps' style board that can be conveniently interfaced using 'dupont' wires, JIS, molex, fpc or some such connectors. the main thing is that for things like stm32 or for that matter nearly all sorts of 'development boards', all of them have different 'form factors' and pinouts. 'shields' is becoming too rigid for the fluid world of 'development boards'.
the pin headers should be on one side of the boards only, ramps arduino mega interfacing pins are sometimes a 'frustration' as it makes it difficult to mount the board on a flat surface, e.g. an acrylic board as a mounting plate, and that such a board should be easily mounted with ordinary m3 machine screws.

for that matter i'm using the 'ramps' board exactly this way, it'd be hooked up with 'dupont' wires to a stm32f407vet6 black board.
the benefit here is the pin assignments on the stm32 board can be changed / redefined as one deems fit anytime and it is as fluid as the software/firmware itself 'everything can be redefined', peripherals added / changed / removed and firmware recompiled as deemed fit.
use cases are many, e.g. first start with a 'basic' printer, then later add 'auto leveling', add an additional extruder, add wifi, add real time clock (change the firmware to support it), add sd cards, add a camera, add more sensors, literally 'infinitely' extendable limited only by sram/flash, cpu prowess and available pins
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: 74HC(T)245 interfacing 5v cifcuits e.g. driving 5v logic level mosfets

Post by ag123 »

ok i found (yet another) 5v logic level 'mosfet driver' or level shifter

it is called 74HCT04
https://www.ti.com/lit/ds/symlink/sn74hct04.pdf

initially i'm upset about it being inverting, until i realize, it is just 6 sets of cmos transistor pairs
https://courseware.ee.calpoly.edu/~dbra ... sales.html
so non-inverting is just connecting the output to the input of another on the same chip.
another pure wire interfacing, no extra resistors no nothing

these are probably the 'most expensive' cmos transistors (ever) as compared to say stm32 with a million times that on the same chip :lol:
but for a 'level shifter', this is possibly 'cheap' as compared to common prices
https://www.aliexpress.com/wholesale?ca ... xt=74hct04

i've decided to get just this as my 'interface board' is a 5cmx7cm perfboard, dip14 is easy with that
https://www.aliexpress.com/wholesale?ca ... er+pcb+5*7

the others that is quite popular seemed to be
74HCT125
74HCT244
as they are straight out non inverting.

it is rather interesting that 74HCT244 are priced at a premium on aliexpress, they don't seem that much more complicated vs the simple chips like 74HCT04. it is probably due to the demand as most would go for the 'straight' (non-inverting) 74hct125, 74hct244 buffers than mess with inverting 74hct04 inverting buffers
https://www.aliexpress.com/wholesale?ca ... t=74hct244

conversely the more complicated, more elaborate 74HCT245
bi-directional so double the number of cmos transistor sets, with gate selectable direction is cheaper, so this is the mass used generic part :lol:
74HCT245
https://www.aliexpress.com/wholesale?ca ... t=74hct245

ok and i've got the whole list of 74HCTxx from nexperia attached
74hctbuffer.zip
74hctxx buffers
(9.97 KiB) Downloaded 188 times
.rpv
Posts: 43
Joined: Wed Dec 18, 2019 10:19 pm

Re: 74HC(T)245 interfacing 5v cifcuits e.g. driving 5v logic level mosfets

Post by .rpv »

The bed mosfet should be the most required to do an pwm level-up, but also it's really slow (~10hz), probably you can use an lm321/lm358/lm324 as comparator, for the heaters and fans the easiest way should be changing the mosfets:

-for the heater(s) the IRLZ44N works fine with 3v3
-on fans use the AO3400A

for the heaters/fans the frequency seems ≥500hz the opams as comparator maybe will work but I'll test it first :lol:
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: 74HC(T)245 interfacing 5v cifcuits e.g. driving 5v logic level mosfets

Post by ag123 »

I think 74HCTxx chips should drive those 5v mosfets on the ramps board, that mosfets section posted a couple posts earlier
viewtopic.php?p=8098#p8098

the thing about 74HCT04 is that those are 'not' gates, hence the outputs would be inverted.
I'm venturing putting 2 not gates in series so that it'd be non inverting, some may warn about propagation delay etc, but i'm seeing specs in the 10s of nsecs. Hence, i'd imagine it isn't after all different if i'd use 2 discrete stages of transistors with one feeding into the other. just that an integrated circuit would save many discrete components, 74HCT04 just about does 3 'non inverting' gates in a single chip, reducing the circuit to just wires.
Hence, it is a solution kind of.

for non-inverting the straight options are 74HCT125, 74HCT244 and 74HCT245, the heatbed/hotend mosfets gates have a capacitance of around 1nF each. i'd imagine the cmos output stages of 74HCTxx with on resistances around a couple 100s of ohms isn't much an obstacle as long as the pwm isn't too fast. i hardly think a heated bed and hotend needs anything more than a couple khz pwm speeds at most to get temperatures in control.
.rpv
Posts: 43
Joined: Wed Dec 18, 2019 10:19 pm

Re: 74HC(T)245 interfacing 5v cifcuits e.g. driving 5v logic level mosfets

Post by .rpv »

So I was curious and I tried:

Channel 1 (yellow) it's the DUT output, Channel 2 (green) it's the fungen, the VIN on the DUT was 5V.

LM321 with no load:
lm321_noload.png
lm321_noload.png (41.66 KiB) Viewed 3865 times
LM321 with 1nf capacitor as load (barely any difference):
lm321_1nf.png
lm321_1nf.png (41.58 KiB) Viewed 3865 times
For comparison, SN74LVC1G17 with 1nf cap as load:
SN74LVC1G17_1nf.png
SN74LVC1G17_1nf.png (21.86 KiB) Viewed 3865 times
I forgot that the LM321 isn't rail-to-rail, so instead use the lmv321, should work at least the same, probably better, while the lm321 can be connected to at 12v probably the performance will be worst.

Anyway, I tested on breadboard so I can't test at higher frequencies, also there's a lot of noise here, but you can see that at 10hz you can use anything.
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: 74HC(T)245 interfacing 5v cifcuits e.g. driving 5v logic level mosfets

Post by ag123 »

@.rpv thanks!

ok i'd need to fix up my blue pill 'oscilloscope' & get that 74HCTxx (on the way) :mrgreen:

but SN74LVC1G17 seemed the best of them all.
this and the 74HCTxx series are hcmos devices,
https://www.ti.com/lit/pdf/scla007
so I'd guess it kind of says that hcmos devices are after all good mosfet gate drivers. just that they'd need to be 5v logic level mosfets.

oh and your SN74LVC1G17 is so 'powerful' it cause your power supply to oscillate :lol:
.rpv
Posts: 43
Joined: Wed Dec 18, 2019 10:19 pm

Re: 74HC(T)245 interfacing 5v cifcuits e.g. driving 5v logic level mosfets

Post by .rpv »

ag123 wrote: Tue Aug 24, 2021 11:35 am @.rpv thanks!

ok i'd need to fix up my blue pill 'oscilloscope' & get that 74HCTxx (on the way) :mrgreen:

but SN74LVC1G17 seemed the best of them all.
this and the 74HCTxx series are hcmos devices,
https://www.ti.com/lit/pdf/scla007
so I'd guess it kind of says that hcmos devices are after all good mosfet gate drivers. just that they'd need to be 5v logic level mosfets.

oh and your SN74LVC1G17 is so 'powerful' it cause your power supply to oscillate :lol:
How you dare to criticize my DIY power supply :lol:

So I'm revisiting my solder station project and I'm going to use this idea, I realized that I made a mistake on my previous tests: I didn't use any by-pass capacitance on the SN74LVC1G17 and with the long wires and the breadboard thing that was the oscillation issue, so by using an 100nF capacitor on the SN74LVC1G17 seems that solve that issue but still added a second 1uF cap, with that I got interesting results:

With 1nF cap as load:
SN74LVC1G17_1nf_wbpc.png
SN74LVC1G17_1nf_wbpc.png (38.11 KiB) Viewed 3664 times
It seems that works quite OK up to 500KHz.

BUT on the KHz area this will be very depending on the mosfet gate capacitance, using a 15nF cap as load (that is more on the 20nF zone) probes it:
SN74LVC1G17_20nf_wbpc.png
SN74LVC1G17_20nf_wbpc.png (19.21 KiB) Viewed 3664 times
And just to push things, with an 100nF cap as load :lol:
SN74LVC1G17_100nf_wbpc.png
SN74LVC1G17_100nf_wbpc.png (20.78 KiB) Viewed 3664 times
I'm using 50KHz pwm on my solder station project but I'm using mosfets that doesn't have so much gate capacitance, I'm giving this a try :D

With 10Hz PWM the mosfet has to have a LOT of capacitance to be a problem, so you're completely on the safe area.
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: 74HC(T)245 interfacing 5v cifcuits e.g. driving 5v logic level mosfets

Post by ag123 »

Don't worry I'm just pulling your legs, at least your power supply reacted, it is at least a correct reaction :lol:
I don't think mosfet gates has that much electrolytic capacitance (oh but they are thin), so those cap load simulations are a little more conservative. But a mosfet that huge with enough gate area that generates that much capacitance, i'd guess it'd drive (10s of?) kilowatts of power. :lol:

But i'd guess this 'findings' is kind of good as specialized 'gate drivers' tend to be more elaborate than necessary (e.g. normally includes high side drives, for buck converters, h-bridges etc) and some are a little pricey. Using discrete transistors to drive is ok, just that those would add lots of discretes. Especially if we want to use those elaborate, totem pole style drivers.
https://microcontrollerslab.com/totem-pole-tutorial/
It so happen that HCMOS is exactly this, it is that 'totem pole' by its own nature.
Post Reply

Return to “Off topic”