1
\$\begingroup\$

I am trying to establish SPI connection between C8051F931 and SD card. One of the sample programs I have found contains the following comments.

// P0.0 - SPI SCK    (digital output, push-pull)
// P0.1 - SPI MISO   (digital input, open-drain)
// P0.2 - SPI MOSI   (digital output, push-pull)
// P0.3 - SPI NSS    (digital output, push-pull)

Do I have to connect some resistance in both the case (push-pull,open-drain) ? if yes what values?

\$\endgroup\$
1
\$\begingroup\$

Push-pull digital outputs require no pull-up or pull-down resistor. They are outputs that produce either a high or a low voltage close to the supply voltages.

Open-drain digital inputs are a little bit of a contradiction unless one presumes it is a digitally configurable input/output where the output is an open-drain and not push-pull configuration. If used as an input I suggest a 10k pull-up resistor. If used as an output 10k may do but so might 1k if the output is expected to switch greater than a few hundred micro-amps.

\$\endgroup\$
1
\$\begingroup\$

When an output pin is open drain and the device that its drives expects to be driven by a push-pull output you will have to provide the missing 'pull to high' in some way, a pull-up resistor being the most common way.

The only open drain pin in your list is marked MISO, which means Master In / Slave Out. That means that for your microcontroller this is an input, so the output stage of the microcontroller is not used and hence irrelevant.

Note that when the corresponding SD card pin is open drain, you will still need a pull-up resistor.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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