​​
Hi all,

​(This got interesting enough that I ended up also making it a blog post here: http://www.secretlab.ca/archives/164)

I've made some progress on the i2c issues seen with the sensors board. I hooked up a pca9306 level shifter and compared the behaviour on the sensors board using an oscilloscope. All of this testing is done with Seeed's Grove RGB LCD module. The LCD module is useful because it actually has 2 i2c devices embedded in it, the LCD controller at address 0x3e, and the RGB controller at 0x62. The two devices operate independently with different electrical properties.

​On Hikey+sensors (TXS0108) the LCD locks the bus, and RGB will work, but only after pulling the ribbon cable apart to reduce crosstalk due to insufficient pullups
On Hikey+pca9306 the LCD isn't detected and the RGB works correctly (undetermined if there are crosstalk issues)

​The traces below show both sides of the level shifter. Green and blue on the top for the data line. Orange and purple on the bottom with the clock.​

First, what I saw on using Hikey+pca9306+RGB:
Inline image 1

​And with the LCD:

Inline image 2

In both traces you can see the start condition (data goes low while clock is high), the 7 bits of address (7 rising clock edges), the R/W bit (1 rising clock), and then the acknowledgement bit driven by the device. If the controller doesn't see the device drive the data line low on the 9th clock, then it decides the device isn't there and it terminates the transaction. It is easy to recognize the ack bit because the device has a different drive strength and the voltage level is different.

The RGB controller is a happy little device and it jumps at the chance to drive the data line low. It goes right down pretty close to 0V. The LCD on the other hand is sulky and doesn't drive the line quite as low as the controller can. About to 1V. 1V is probably recognized as a logic low on a 5V device, but with 1.8V it is not even less than half. The way the pca9306 level shifter works is there are pull-up resistors on either side of the device that draws each side up to its respective high level. In this case, 1.8V and 5V. When either side gets driven low, the level shifter begins to conduct and the other side also gets drawn down to the same voltage, but it can only go as low as the voltage it is driven to. If it only gets driven down to 1V, then it will never get low enough for a 1.8V controller to recognize it as a low state.

It may be that with weaker pull-ups the LCD will be able to drive to a lower voltage level. I'll need to experiment more, but in the mean time let's move onto the Sensors board. Back to the traces:

First, here is a transaction to address 0x63 with no device present:

Inline image 3

​Looks perfectly normal so far. Next, the RGB device at address 0x62:

Inline image 4

Also behaving the same way as it did with the pca9306. Finally, an LCD transaction:

Inline image 5

Again we see the start condition, the 7 data bits and 1 r/w bit, but the ack bit looks weird. The LCD successfully drives the data bit low enough to be recognized, but then something weird happens. The data line stays low and the clock stops running. I don't know actually know what is happening here, but I've got my suspicions. The LCD is continuing to drive the data line low, (you can tell by the slightly different voltage level) but keeping data low should not stop the clock. I suspect the txs0108 is getting confused and driving the clock line high. I've come across reports from others having trouble with the txs010x series on i2c. It has 'one-shot' accelerators to reduce rise time by driving the line high.

Now I need to decide what to do next. Rev B of the design is ready, but there is still the i2c issue that needs to be solved. I may need to put the pca9306 parts into the design which will require some more rework before it goes to manufacturing.

g.