6 ms·
Interesting, is the pullup resistor common for other protocols like SPI?
by syntaxing 6y ago
Interesting, is the pullup resistor common for other protocols like SPI?
- jeff_ciesielski 6y agoI hate to give an 'it depends', but it depends. Typically, no. In SPI all lines are actively driven high or low rather than an open drain configuration. The bus master drives SCK (SPI clock), MOSI (master out, slave in) and CS (chip select), and the slave device(s) drive the MISO (master in, slave out) line(s). From an operating perspective, pullup/pulldown resistors are not required. Now having said that, in some cases it's considered appropriate to add weak pullup/pulldown resistors to the data lines to ensure that they're in the expected state on power up and to prevent glitches from putting slave devices into weird states.
- monocasa 6y agoThree wire SPI is pretty common where everyone's MOSI and MISO are connected together open drain style, and the master clocks out 1s to let the slave pull the data line down for read operations. You have clock out something from the master during 4 wire SPI read anyway so it doesn't change a lot most of the time.
- magicsmoke 6y agoThe pull-up resistor allows I2C to have multiple masters on the same bus. A master take control of the bus by pulling either sck or sda low (can't remember which) and if other masters detect a low voltage when it expects a high it knows the bus is currently taken. SPI only has one active master on the bus at a time, so there's no need for pullup resistors to implement this arbitration mechanism. SPI masters just drive their bus lines using push-pull outputs.
- el_isma 6y agoIt's even cooler than that: it has collision avoidance. To start a transfer you drive the clock low. If both masters drive the clock low at the same time. Then they start driving SDA with the address. If at any point in time, the address you are trying to put in the bus is not there, you stop. This could happen if you try to drive a 1 and the other master does a 0 (since it's open collector, the 0 will win), and you know you couldn't put your '1' in the bus, so you shut up and let the other master carry on.
- analog31 6y agoIt's worth noting that I2C dates back a long ways, when we were still doing a lot of things like TTL, and weird asymmetric termination circuits were the norm. And it was under patent for a long time, so its development was stunted, and a lot of people used I2C peripherals by bit-banging GPIO pins with primitive code. Virtually all SPI devices that I know of are CMOS with push-pull outputs and high-impedance inputs, which are much more friendly to work with. Until you try to drive the bus with two devices by accident. See my other comment about series resistors. I have a circuit right now that's operating a SPI bus with a 100 MHz clock on a small two-layer board and I'm getting away with it. A real engineer wouldn't allow this, but it's strictly for a research project.
- mindentropy 5y agoAlso series resistors are used to prevent ringing etc acting as a termination resistor.