logo elektroda
logo elektroda
X
logo elektroda

Bit Banging I2C for communication between Raspberry Pi and PCF8591

483 6
ADVERTISEMENT
  • PCF8591 channel selection and differential mode setup

    #1 21680310
    John Manuel
    Anonymous  
  • ADVERTISEMENT
  • Explains PCF8591 address and control bytes

    #2 21680311
    Richard Gabric
    Anonymous  
  • ADVERTISEMENT
  • I2C addressing and logic analyzer debugging advice

    #3 21680312
    Jacob Beningo
    Anonymous  
  • #4 21680313
    Max Maxfield
    Anonymous  
  • ADVERTISEMENT
  • Recommend hardware I2C over bit-banging on Raspberry Pi

    #5 21680314
    Duane Benson
    Anonymous  
  • ADVERTISEMENT
  • PCF8591 can only sample one channel at a time

    #6 21680315
    John Manuel
    Anonymous  
  • Suggesting simultaneous-sampling ADCs instead of I2C scanning

    #7 21680316
    Richard Gabric
    Anonymous  

Topic summary

LABEL_AI_GENERATED
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.
AI summary based on the discussion. May contain errors.
ADVERTISEMENT