I am using SPI with an Arduino Uno for a few different things. My project's buttons are all running through a 74HC165 shift register to the Arduino's MISO. Unfortunately, the 165 has no 0E. As such, it seems that the 165's output is constantly on even though it's slave select is off. This is interfering with the MISO of other SPI devices I am using at the same time. I need a way of turning the 165's output off (ie linked to slave select).

Is it possible to use an n-MOSFET to control the data flow from the 165's output to the Arduino's MISO? Or do I need to use an IC like the 74HC125?

Thank you very much in advance!


1 Answer 1


Yes, the '165 is just a shift register. It was never intended to be a fully SPI-compatible device.

Using an N-channel MOSFET would convert its output into an open-collector (really open-drain) output with enable. If you go this route, you'll need to have a pullup resistor on the MISO line, because the MOSFET will only be able to pull it low. Also, the gate of the MOSFET is active-high, so you'll need to invert your SS signal to match. (Actually, I guess you can use the same signal that you're driving the '165's \$\text{SH}/\overline{\text{LD}}\$ input to drive the MOSFET as well, since you want it enabled while you're shifting.)

The '125 has an active-low enable, and its output is true 3-state, so this is actually the more direct approach, especially if you have more than one device you want to connect to MISO.

  • \$\begingroup\$ You'll also need to be careful to use a logic-level MOSFET. "Regular" MOSFETs won't turn on reliably with 5 volt logic signals. Almost reliably, but not quite. \$\endgroup\$ Aug 20, 2016 at 16:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.