Close

I2C to IS31FL3733 with the Bus Pirate

A project log for Confagrid

Software and Hardware to make Word Clocks easier to make

Stephen LeggeStephen Legge 06/02/2018 at 02:530 Comments

I'm really glad I picked up a Bus Pirate, it makes figuring out the I2C communication with the IS31FL3733 pretty slick.  Instead of trying to compile/re-compile/flash a binary for some micro, you can just try to interact directly with the peripheral and get immediate feedback and figure out what works.

Here's how I turn on LED[0,0] (CS1 to SW1).

The Bus Pirate starts out with a 'HiZ>' prompt, you hit 'm' to change modes and then select the mode you want (I wanted I2C for the IS31FL3733, which is 4).

HiZ>m
1. HiZ
2. 1-WIRE
3. UART
4. I2C
5. SPI
6. 2WIRE
7. 3WIRE
8. LCD
9. DIO
x. exit(without change)

(1)>4
Set speed:
 1. ~5KHz
 2. ~50KHz
 3. ~100KHz
 4. ~400KHz

(1)>4
Ready

Then you need to turn the power supplies on with 'W'.

I2C>W
Power supplies ON

Now you can communicate over I2C with formatted text.  The way I have my dev board configured the address of the I2C slave is '0x50' which you shift left one bit and OR with the R/W bit, so to write I start with '[' for start and then '0xA0' for the device and then register and value.  I don't really understand why, but for the IS31FL3733 you need to change 'pages' in order to write to the registers you want and you need to unlock the ability to change pages each time you need to.  Writing '0xC5' to register '0xFE' unlocks for a one time page change and then you set the page you want at register '0xFD'.

This is how you unlock the page change register:

I2C>[0xA0 0xFE 0xC5]

 and then it responds with:

I2C START BIT
WRITE: 0xA0 ACK
WRITE: 0xFE ACK
WRITE: 0xC5 ACK
I2C STOP BIT

 

I'll leave out the responses for the rest of the commands since they're all just ACKS like that.  So,
you need to change to page 3 and enable the chip and set the global brightness (I set to full here)

change to page 3:

I2C>[0xA0 0xFE 0xC5]
I2C>[0xA0 0xFD 0x03]

enable chip and OSD:

I2C>[0xA0 0x00 0x05]

set global brightness to 0xFF (255/255):

I2C>[0xA0 0x01 0xFF]

change to page 1 (PWM):

I2C>[0xA0 0xFE 0xC5]
I2C>[0xA0 0xFD 0x01]

set first LED to full PWM (255/255):

I2C>[0xA0 0x00 0xFF]

change to page 0 (EN/DIS):

I2C>[0xA0 0xFE 0xC5]
I2C>[0xA0 0xFD 0x00]

set first LED to enabled:

I2C>[0xA0 0x00 0x01]

an LED with it's anode connected to CS1 and cathode connected to SW1 will turn on, yay!

Seems like a lot of work to turn on an LED, but that's just the start.

Discussions