ZHCSSA6C september 2009 – june 2023 ADS1000-Q1
PRODUCTION DATA
Most microcontrollers have programmable input and output pins that can be set in software to act as inputs or outputs. If an I2C controller is not available, the ADS1000-Q1 can be connected to GPIO pins, and the I2C bus protocol simulated, or bit-banged, in software. An example of this process for a single ADS1000-Q1 is shown in Figure 8-3.
Bit-banging the I2C with GPIO pins can be done by setting the GPIO line to zero and toggling the line between input and output modes to apply the proper bus states. To drive the line low, the pin is set to output a 0b; to let the line go high, the pin is set to an input. When the pin is set to an input, the state of the pin can be read; if another device is pulling the line low, the controller reads 0b in the port input register.
No pullup resistor is shown on the SCL line. In this simple case, the resistor is not needed; the microcontroller can simply leave the line configured as an output, set to 1b or 0b as appropriate. The microcontroller can leave the line as an output because the ADS1000-Q1 never drives the clock line low. This technique can also be used with multiple devices, and has the advantage of lower current consumption resulting from the absence of a resistive pullup.
If there are any devices on the bus that can drive their clock lines low, do not use this method. The SCL line must be high-Z or zero and a pullup resistor must be provided as usual. This method cannot be done on the SDA line in any case, because the ADS1000-Q1 does drive the SDA line low from time to time, as all I2C devices do.
Some microcontrollers have selectable strong pullup circuits built into the GPIO ports. In some cases, these circuits can be switched on and used in place of an external pullup resistor. Weak pullup resistors are also provided on some microcontrollers, but usually these resistors are too weak for I2C communication. If there is any doubt about the matter, test the circuit before committing to production.