Close

Configuration through I2C

A project log for RRB - The Radio Rewind Button

Radio killed the Video-recorder Star

magicwolfiMagicWolfi 08/20/2018 at 01:160 Comments

For ease of configuration I am hooking up a Bus Pirate (or as I prefer to call him Bus Privateer, because they are the good pirates) to the I2C interface and run scripts with all config commands through my terminal program of choice (Teraterm).

Example (might be good to put this into the instructions section):

Initial commands:

Bus Pirate configuration and run macro (1) to scan all device:

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
I2C>(1)
Searching I2C address space. Found devices at:
0x22(0x11 W) 0x23(0x11 R) 0x30(0x18 W) 0x31(0x18 R)

 7bit address 0x11 is the Si4731 FM receiver, 0x18 is the audio processor TI PCM3070. Nice.

Si 4731: Power up and request revision information:

I2C>[0x22 1 0xc0 5]
I2C START BIT
WRITE: 0x22 ACK
WRITE: 0x01 ACK
WRITE: 0xC0 ACK
WRITE: 0x05 ACK
I2C STOP BIT
I2C>[0x23 r]
I2C START BIT
WRITE: 0x23 ACK
READ: 0x80
NACK
I2C STOP BIT
I2C>[0x22 0x10][0x23 r:8]
I2C START BIT
WRITE: 0x22 ACK
WRITE: 0x10 ACK
I2C STOP BIT
I2C START BIT
WRITE: 0x23 ACK
READ: 0x80  ACK 0x1F  ACK 0x36  ACK 0x30  ACK 0x00  ACK 0x00  ACK 0x37  ACK 0x30
NACK
I2C STOP BIT

PCM3070: Write 0x42 into the page select register and read back for testing as this one does not have an ID or revision register

I2C>[0x30 0x00 0x42]
I2C START BIT
WRITE: 0x30 ACK
WRITE: 0x00 ACK
WRITE: 0x42 ACK
I2C STOP BIT
I2C>[0x30 0x00][0x31 r]
I2C START BIT
WRITE: 0x30 ACK
WRITE: 0x00 ACK
I2C STOP BIT
I2C START BIT
WRITE: 0x31 ACK
READ: 0x42
NACK
I2C STOP BIT

That was easy. Now I have to read all the programming and configuration guide.

Discussions