HiFive1 I2C Slow Soft Wire fails with some devices

(Gil) #1

I have a SiFive HiFive1 development board and I mounted on it an I2C Shield (SparkFun Qwiic Shield for Arduino) for easy I2C connection to multiple sensors and devices.

I configure the HiFive1 Digital pin 18 and 19 as I2C lines with the SlowSoftWire library code (windows).
When connecting I2C devices (with the Qwicc connectors) I do get some devices discovered ok and also can read and write data (from E2PROM, and LCD), but when connecting the Seeed Air Quality sensor PM2.5 , the device is discovered on I2C address 0x40 but I get bad data (mostly 0xFF).
When connecting same sensor to an Arduino using the same I2C shield, all works well.

Do the 18 & 19 I/O pins on HiFive1 that I use as I2C soft wire bus requires adding pull-up or pull-down resistor of some sort? can you please point me to the recommended connection diagram and best resistor values?


There is a good manual from TI: I2C Bus Pullup Resistor Calculation.

(Gil) #3

Thank you Disasm,
I reviewed this manual and played a bit with different pull-ups and so far with no success.
Consulting the HiFive1 schematics I see not pull-ups or pull-down on these lines, and as adding it did not seem to solve the issue, I thought there is something I may be missing here.
(When looking at serial connection TX/RX to ESP01 that users did, they have added pull-up and pull-down as well as a line load resistor. no sure if this is also relevant here - see step 2 on This Instructables Page)


Try connecting that failing sensor alone.

For I2C you only need two pullup resistors.