Close

I2C Communication is working

A project log for Remote Control SAO

A badge add-on that's a re-programmable remote for your TV or other IR-controllable device and a I2C-controlled IR blaster.

ben-combeeBen Combee 09/30/2024 at 06:060 Comments

I've now validated that I can talk to the CAP1114 chip.  This is the first time I'd used the I2C interface in the Arduino library, and I'm happy that there's a lot of good documentation in the megaTinyCore source.  My first attempt to read out the product ID, manufacturer ID, and revision registers resulted in 0xFFs, and I spent a lot of time checking what was wrong.

First problem I found was that I'd wired the CAP1114 to the alternate I2C pins on the ATTiny1614.  The device defaults to using PB0/PB1, and those are connected to the I2C connector on the SAO, but I used PA1/PA2 for my wiring to the CAP1114.  Eventually after searching through various headers, I found the Wire::swap() call that's a megaTinyCore extension to the Arduino APIs, and was able to use that to reconfigure.

My second problem was using the wrong address.  The datasheet talked about a product ID of 0x3A, so I'd assumed that was the address, then I re-read the protocol description and found that the read address was 0x28, although that was only found after decoding the binary to hex and shifting over one.

Now that I got good reads from the ID registers, I started a serial dump from the button status registers, but those don't make sense yet.  I think I'll need to configure a few more parts of the chip to actually get the values I want from the touch pads.  I can tell some of them seem to be sensed, but they're not returning to an untouched state yet.

Discussions