Electronic – Digital I/O pins connections between IC

digital-communicationsmicrocontroller

I want to ask how is right to connect enable in ICs and digital communication between ICs.

Take for example this:

enter image description here

want to ask about this 3 examples:

  • Should I use a resistor and how I choose it value?
  • It's an error to connect a decoupling cap? (I suppose it's good if I want to have a stable EN but I'll have some delay before EN goes down after my pin5 pull down)
  • What is difference between I2C connection and a simple connection between 2 pins? I see the first have a resistor connected to Vcc and second to Gnd, why this difference?

Best Answer

Based on your comment, in the first case pin 1 and pin 2 are actually on different ICs. Adding a resistor to ground just ensures the lead will be a logic 0 on startup. Usually, I/O pins are initialized by default as high-impedance inputs, and don't become outputs until the microcontroller writes to the I/O configuration registers. Without the resistor, the lead would initially be floating. 4.99K or 10K are typical resistor values. If the initial state of the lead is not important, the resistor can be omitted.

The second case is really the same -- a resistor to ground ensures the EN lead will be a logic 0 on startup. If the sense of the EN lead is reversed, e.g. \$\mathsf{\small \overline{\text{EN}}}\$, then the resistor would be tied to V\$_{CC}\$ instead (same value). No decoupling capacitor is needed -- those are only for power supply pins (V\$_{CC}\$ or V\$_{DD}\$) of logic chips and the microcontroller.

The clock (SCL) and data (SDA) leads of an I²C bus each have to have a pull-up resistor to V\$_{CC}\$. This is because the I²C outputs of a master or slave device have open-drain outputs -- they only sink current (logic 0), and never source it (for logic 1). This is what allows several devices to be placed on the same bus. Again no decoupling capacitor is needed (wouldn't hurt anything, but it's not standard practice.)