Pullup vs gpio output drive

Status
Not open for further replies.

tonton81

Well-known member
just out of curiosity, and this is on a teensy 3.5... If a 5V SPI device has a pullup on a 5v rail which is common ground with teensy, and when teensy 3.5 de-asserts the line ((CS))pulling it high), wont it try (well, of course it will) to drive 3.3v, while the 5v pullup is on the same CS line?

won't the 2 voltages fight each other? ( i doubt the slave even cares, it's not his problem as the logic is correct, but the teensy side effects?)

Tony
 
You bacially have 5v on one rail and 3v3 on another which are connected via two series resistors. So current will flow through the resistors, that is true.

You can work it out with ohms law. 1.7v divded by the sum of the two pull-up reststors.
 
im talking about the CS pin
the output HIGH will be 3.3v but the CS line is pulled HIGH @ 5V on the slave SPI device, where did that series resistor come from?
 
Last edited:
There's a difference between 'driven' high and 'pulled' high.

Think of it like this; Driven is as good as connecting it directly to the power supply, whereas pulling it high goes through a resistor to the power supply.

When CS is asserted low, it is 'driven' low. This is as good as being shorted to ground. At this point, there is current flow through the pull up resistor, but not much current as pull ups tend to have relatively high ohm values. When CS is de-asserted, the micro is not driving it high or low, it simply 'lets go'. So the pull-up resistor naturally brings the voltage on the CS line back to the supply level, so that no current flows through the resistor.

Maybe I misunderstood your question, but I thought you were asking about a 5v supply with a pull-up to the CS line, and a 3v3 supply (internal to the micro) with the internal pull up resistor also connected to the CS line. This is the same as having a 1.7v volt drop across the two pull up resistors.
 
Status
Not open for further replies.
Back
Top