logo elektroda
logo elektroda
X
logo elektroda

Bit Banging I2C for communication between Raspberry Pi and PCF8591

90 6
ADVERTISEMENT
  • #1 21680310
    John Manuel
    Anonymous  
  • ADVERTISEMENT
  • #2 21680311
    Richard Gabric
    Anonymous  
  • ADVERTISEMENT
  • #3 21680312
    Jacob Beningo
    Anonymous  
  • ADVERTISEMENT
  • #4 21680313
    Max Maxfield
    Anonymous  
  • #5 21680314
    Duane Benson
    Anonymous  
  • #6 21680315
    John Manuel
    Anonymous  
  • ADVERTISEMENT
  • #7 21680316
    Richard Gabric
    Anonymous  

Topic summary

The discussion addresses interfacing multiple PCF8591 ADC chips (around five) with a single Raspberry Pi via the I2C protocol. Since the Raspberry Pi has only one hardware I2C bus with dedicated SDA and SCL pins, the user attempts bit-banging I2C on other GPIO pins using the RPi.GPIO Python library. However, bit-banging I2C on the Raspberry Pi is discouraged due to its non-real-time OS, which causes timing inaccuracies critical for I2C communication. The PCF8591 supports multiple devices on the same I2C bus by configuring hardware address pins A0-A2 to assign unique addresses. The device's control byte selects the ADC input channel (AIN0 to AIN3) and configures single-ended or differential input modes. Reading data from specific analog inputs requires sending the correct control byte after addressing the device. For simultaneous sampling of multiple ADCs, I2C is limited since the master communicates with one slave at a time, causing data skew when multiplexing. Alternative solutions include using ADCs with simultaneous start commands or SPI-based ADCs for faster, more synchronized sampling. Recommendations include starting with a single PCF8591 on the hardware I2C bus to understand communication, using logic analyzers to monitor I2C signals, and avoiding bit-banging on the Raspberry Pi for precise timing requirements.
Summary generated by the language model.
ADVERTISEMENT