tigard-tools / tigard

An FTDI FT2232H-based multi-protocol tool for hardware hacking
Other
560 stars 65 forks source link

I2C header wiring is incorrect #1

Closed securelyfitz closed 4 years ago

securelyfitz commented 4 years ago

There are diodes between the SDA/SCL pins and the CK/DI/DO pins to protect JTAG and SPI from the I2C pullups.

Unfortunately these diodes prevent I2C device's response from getting back to the FT2232H - When trying to read an I2C eeprom, using the SPI header works, using the I2C header does not.

The FT2232H doesn't do real push-pull, it ties in and out wires to each pin to make it work.

  1. Since we don't support clock stretching (at least, the hardware doesn't - if that should change, separate issue), then we can remove the diode and pullup on SCL.

  2. Since we already have a dual pole switch to combine DI and DO for both I2C and SWD, we can use the second pole to switch in a pullup

  3. The remaining difference between SPI and I2C headers are CS and MISO. Some 8 pin I2C chips use those pins for address bits. AFAIK those are only checked at poweron, but i haven't tested and wouldn't be surprised if they mess with other devices. CS is unused in I2C mode, but MISO could theoretically interfere. Perhaps the I2C/SWD switch could also disconnect the spi header MISO pin with no additional hardware?

I can bluewire whatever changes we decide on to make sure they work - and perhaps also experiment with removing the SDA pullup entirely?

securelyfitz commented 4 years ago

Test: pulling off diodes and pullups, I2C still works fine both with bare devices and in-circuit. Likely works because 1) in-circuit has pullups on the target and 2) bare device, the level shifter is sensitive enough that the 100k pullups are sufficient.

securelyfitz commented 4 years ago

So, confirmed todo:

  1. remove i2c header
  2. remove i2c diodes and pullups
  3. rotate SPI header so even numbered pins face board edge

breaking off switch options to separate issue #5