Referring to the “electrical type of schematic symbol pins” FAQ, https://forum.kicad.info/t/electrical-type-of-schematic-symbol-pins/9439, I still feel uncertain with respect to how to define device SPI output pins (MISO). The practice in the official library seems to vary. For instance in the library Memory_EEPROM.lib 25LC_EEPROM has all pins, even MISO defined as Input. Logically that does not seem right. Another example, LTC1644CGN in the adc-dac library has DOUT/MISO pins defined as Output. But if defined as output there will be DRC errors when multiple SPI devices have MISO pins on the same bus.
The problem is of course that these pins change between being output when chip is active and otherwise high impedance, typically when chip is not selected, for instance when another device on the bus is active. DRC does of course not “understand” that. It seems to be common practice to not have pull up or pull down resistors on these pins, and in my own experience this works well.
Sadly there are still symbols in the official lib that are not of very high quality. I think the miso pin should be an input for the master and a tristade for slaves.
Some devices offer i2c and spi on the same pins. For such devices one would either have to make a separate symbol depending on selected bus interface or the pins might need to be defined as bidirectional.
Yes, that is right for MCUs I am using. (As long as the MCUs MOSI pin does not oscillate in a non-defined state causing increased power consumption, the state of the pin is functionally irrelevant when SPI is inactive). The question is what is the most correct pin setting for the symbol of the connected device? In some data sheets, for instance for LTC2400/2410 (these are not in the official library), MOSI is designated as a 3-state output. Several more devices I checked in the official library defines MOSI as output, but it will as stated cause DRC errors with multiple devices on the bus. Perhaps Tri-state would be a more suitable pin property for MISO pins?
Thanks Rene, (I edited my last message in parallel with your reply). I tend to agree. Can you point me to a slave device in the library that uses Tri-state for MISO? Could this be expressed clearer in the FAQ (“pins that have a z-high state are tri-state”)?
Thanks Rene, found it (with tri-state) although my version is a bit old as I have not updated the library since late November; will do soon once things have settled a bit more. Thanks for the FAQ change!
(I corrected to MISO in my message above)
A little slip; I should have left out the word resistor in the above. The specs can vary though, for instance the dsPIC 33F series the specification for CNx Pull-up Current is Min 50μA Typical 250 μA, Max 400 μA. (I suspect you mean 50% to 200% of nominal value, as -50% sounds like a current with opposite polarity). While it further states that “the pull-ups act as a current source that is connected to the pin and eliminate the need for external resistors when push button or keypad devices are connected”, it is likely wise to not depend on these for signaling. Also on some chips the pull up (or in some cases pull down) need to be configured to be active.
The minus sign does not refer to current direction but rather that the tolerance on the low side is different than that on the high side. So 100 uA +/- 10% can be 90 to 110 uA. 100 uA -50 +100 % is 50 to 200 uA. Your example is 250 uA -80 +60%