I2C to MCU's page0, page1

I connect I2C signal between Arduino and TI DSP IC and I need to write some data to the TI DSP register.
But there have 2 pages: page0 and page1.

How can I choose page_0 or page_1 and write the data to register1, register2 ....... register(xx)?

thanks.

Well to start it, it would probably help to tell us which DSP IC you're using.

Hi,

I use TI TAS3251, SPEC as attached.

I2C data starts on page 32.

thanks.

TAS3251.pdf (1.86 MB)

Which Arduino board do you use ?

When you use an Arduino Uno, then you have a 5V I2C bus.
The interface of the TAS3251 runs at 3.3V, so it has a 3.3V I2C bus.
The maximum voltage on the SDA and SCL pins of the TAS3251 is VDAC_DVDD + 0.5, that is 3.8V.

The first thing to do is to run a I2C Scanner sketch, to check if the I2C bus is working.

The I2C of the TAS3251 works just as any other normal I2C device. For writing, first the 8-bit register-address is written, then one or more data bytes. For reading, the register-address is written, then a repeated start and then the databytes are read.

Hello Koepel,

I can found 3x I2C address

Scanning...
I2C device found at address 0x4B ! (TAS3251)
I2C device found at address 0x65 ! (XMOS)
I2C device found at address 0x70 ! (SRC)
done

After I changed the TAS3251 I2C address setting, I2C changed from 4B to 4A

I think I2C syntax might be :

  1. I2C_WRITE (address)
  2. I2C_WRITE (pagex, data)

but I don't know how to select register page(x)

thanks,

I2C.jpg

The "I2C_WRITE" is not Arduino code with the Arduino Wire library. Can you show your sketch ?

Koepel:
The "I2C_WRITE" is not Arduino code with the Arduino Wire library. Can you show your sketch ?

Hello Koepel,

I have seen how to switch book, page and register, please refer to attached.
But I'm not quite familiar with I2C.

Here is an example, is it correct

Wire.beginTransmission(4B); // TAS3251 I2C address
Wire.write(0x00); // goto page0
Wire.write(0x7f); // goto resister 0x7f (page0)
Wire.write(0x8C); // Write 0x8C to 0x7f register (slesect 0x8C book)
Wire.write(0x30); // Select 0x30 register address in book 0x8C
Wire.write(0x00); // Write 0x00h data to 0x30 register
Wire.endTransmission( );

It feels messy, hope you know what I want to say

thanks.

First the register-address is written, then the data bytes. The first byte with "Wire.write()" is always the register address.
You can also not concatenate more than one command.

I don't know if this is right, but it should look more like this:

// Go to page 0
Wire.beginTransmission( 0x4B);    // TAS3251 I2C address
Wire.write( 0x00);           // register address 0
Wire.write( 0x00);           // select page 0
Wire.endTransmission( );

// Change the book to 0x8C
Wire.beginTransmission( 0x4B);    // TAS3251 I2C address
Wire.write( 0x7F);           // register address 0x7F
Wire.write( 0x8C);           //  select 0x8C book
Wire.endTransmission( );

// Write 0x00 to register address 0x30
Wire.beginTransmission( 0x4B);    // TAS3251 I2C address
Wire.write( 0x30);           // register address 0x30 (in book 0x8C)
Wire.write( 0x00);           // data 0x00 (to 0x30 register)
Wire.endTransmission( );

Should the page be set, after the book 0x8C is selected ?

When a I2C Scanner finds a device, then the next step is to read an identifier from the chip.
Register 0x58 has device ID of 0x84.

Wire.beginTransmission( 0x4B);
Wire.write( 0x58);     // register address 0x58 is DIEI (chip ID)
Wire.endTransmission( false);  // false for a repeated start

Wire.requestFrom( 0x4B, 1);   // request 1 byte
int id = Wire.read();
Serial.print( "ID = 0x");
Serial.println( id, HEX);

I don't know if register 0x58 can be selected just like that, or should first a book and a page be selected ?

What about the difference in voltage levels on the I2C bus ?

Hello Koepel,

The I2C voltage level is +5V.
I will test your suggested I2C function.

thank you.

Koepel:
The interface of the TAS3251 runs at 3.3V, so it has a 3.3V I2C bus.
The maximum voltage on the SDA and SCL pins of the TAS3251 is VDAC_DVDD + 0.5, that is 3.8V.

Hello Koepel,

I update the voltage level as attached. the voltage is 3.4V.

thanks.