Electronics > Projects, Designs, and Technical Stuff
Pullup or not?
<< < (2/2)
SiliconWizard:
As said - check with your MCU in particular, but nowadays, most of them have Schmitt trigger inputs anyway, so the additional gate is useless.
As for debouncing, I'm not against what you did here, depends on the kind of input you use really. Since it seems to be designed for "digital inputs" as well, I'm not sure the RC filter would really be a benefit in this case. As for the clamping diodes, why not, but I would then add a series resistor *before* the diodes. Depending on your input signal, you may even want to add a TVS diode.

Point is - the extra gate is likely useless here, and more generally speaking, designing some kind of "universal" input like you seem to be doing here is IMHO not a very good idea. It's IMO a better approach to adapt it to the kind of input you'll really have to deal with. If you're using a mechanical switch, the extra clamping diodes are probably useless. OTOH, if the input can be connected to some kind of external signal through a connector, then better protection than what you did here would probably have to be considered.

As for pullups - leaving CMOS inputs floating is never a good idea. If nothing else, it will tend to draw unncessary current.
But if you get rid of the extra gate and enable internal pullups of the MCU, then the point is moot. No extra pullup needed, although depending again on your specific case, you may want to add an external, smaller value pullup (like 10k or lower) to avoid potential spurious state change due to external perturbation.
donmr:
Enabling a pullup inside the uC is the same thing as putting R1 outside.  Pullups are so common and useful that many devices include them for you.
phil from seattle:
Thanks for the constructive comments.  Thought I had mentioned it but the ST is there because I need 5V tolerant input, the package happens to be nice and small and some inputs will benefit from the ST. So, not a waste of parts and I can't use the uC's features.

The micro is actually one of several possible micros, all of which have STs on their input but again, that's irrelevant to the point.

Moving the diode inside is a good idea though I don't expect particularly high energy here, more like EMI. That should not effect the LP filter operation.

But to the original point, I will bite the bullet and add the pullups.

SiliconWizard:

--- Quote from: phil from seattle on June 06, 2020, 03:50:22 pm ---Thanks for the constructive comments.  Thought I had mentioned it but the ST is there because I need 5V tolerant input, the package happens to be nice and small and some inputs will benefit from the ST. So, not a waste of parts and I can't use the uC's features.

--- End quote ---

OK, that wasn't mentioned. Makes sense then. BUT: there is definitely a problem with your design then, as it's itself NOT 5V tolerant; notably due to the upper clamping diode which clamps to 3.3V. If your input goes up to 5V, it won't be pretty.
Miti:

--- Quote from: phil from seattle on June 06, 2020, 03:50:22 pm ---Thanks for the constructive comments.  Thought I had mentioned it but the ST is there because I need 5V tolerant input, the package happens to be nice and small and some inputs will benefit from the ST. So, not a waste of parts and I can't use the uC's features.

The micro is actually one of several possible micros, all of which have STs on their input but again, that's irrelevant to the point.

--- End quote ---

No, it’s not irrelevant. With a few kohm resistor series and a clamp diode at 3.3V, your uC input is already 5V tolerant. And ST.
Navigation
Message Index
Previous page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod