I²C Project: A Single Flipped Bit

I've been working on trying to get I²C comms working on Mecrisp Stellaris, using the built-in hardware module. I spent many lunch breaks seemingly going nowhere, because I couldn't get the Trellis LEDs to even turn on, and the signals did not look correct on the scope. After much looking at waveforms, reading the manuals, and inspecting code, I finally realized that the command bit in the IC_DATA_CMD register is 0 for write, and 1 for read, and not the other way around.

With that fix, I was immediately able to get the Trellis LEDs to turn on and to start blinking.

Some blurry proof the Trellis LEDs came on

Here is the first test waveform I got after applying the fix.

img/first_i2c_signals.png

The first half is

which is the START pulse, followed by the 7-bit device address $70, followed by the (now correct) command bit, followed by the acknowledgement bit. Then

which is the command $21 (start Trellis oscillator) followed by the acknowledgement bit, followed by the STOP pulse.

Proxied content from gemini://gem.librehacker.com/gemlog/tech/20220913-0.gmi

Gemini request details:

Original URL
gemini://gem.librehacker.com/gemlog/tech/20220913-0.gmi
Status code
Success
Meta
text/gemini
Proxied by
kineto

Be advised that no attempt was made to verify the remote SSL certificate.