# Problems writing data into registers. TPL1401 I2C Digital Potentiometer.

#### Belmont1010

Joined Nov 17, 2022
2
Hello, and sorry for my English.

I want to use a I2C digital potentiometer (TPL1401) so, before I use it, I'm reading the datasheet (I'm not doing any specific application, I just want to improve my few skills in i2c).
In this moment I don't have the IC physically to test, but in page number 31 there is a pseudocode example and my concern are the values that are written in GENERAL_CONFIG and PROTECT registers.

This is the GENERAL_CONFIG register but in the MSB data they write 0x11, why? I dont Have problems with the LSB data (0xE5)

0x11 would be: 0001 0001 and in theory all this bits would be the bits 15-8, right?
i.e.
 bits 15 14 13 12 11 10 9 8 0x11 0 0 0 1 0 0 0 1

but why bit 12 is 1? according to the table bits 12-5 are RESERVED and always you must write 0x0F i.e.
 bits [12:5] 12 11 10 9 8 7 6 5 0x0F 0 0 0 0 1 1 1 1

What do you think, could it be an error in the datasheet?
Or am I the one who is wrong haha

Same case for PROTECT Register, they write 0x10 for the LSB Data, and this is the register, agaim, according to the table, bits [3:0] ony have two possible values 1000 or 1010, so, why they write 0x10

#### Attachments

• 3.9 MB Views: 1
• 139.9 KB Views: 0
Last edited:

#### BobaMosfet

Joined Jul 1, 2009
2,053
The CONFIG register at 0xD1 (it's address) takes a 16-bite value:

Code:
15 | 14 | 13 | 12 | 11 | 10 | 09 | 08 | 07 | 06 | 05 | 04 | 03 | 02 | 01 | 00
----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----
0    0 |  0 |  1    0    0    0    1    1    1    1 |  0    0 |  1 |  0    0
---------+----+---------------------------------------+---------+----+---------
Per the register:

Clearly the datasheet example they provide (0x11E5) is a typo. Bits 12-5 should be 0x00. Follow Table 7-13, not their code example. Same thing goes for any other register. Use their pseudo-code only as a flowchart for how the process is done. Rely on the specific register-related tables for the appropriate values to write.

#### Belmont1010

Joined Nov 17, 2022
2
The CONFIG register at 0xD1 (it's address) takes a 16-bite value:

Code:
15 | 14 | 13 | 12 | 11 | 10 | 09 | 08 | 07 | 06 | 05 | 04 | 03 | 02 | 01 | 00
----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----
0    0 |  0 |  1    0    0    0    1    1    1    1 |  0    0 |  1 |  0    0
---------+----+---------------------------------------+---------+----+---------
Per the register:

View attachment 280964

Clearly the datasheet example they provide (0x11E5) is a typo. Bits 12-5 should be 0x00. Follow Table 7-13, not their code example. Same thing goes for any other register. Use their pseudo-code only as a flowchart for how the process is done. Rely on the specific register-related tables for the appropriate values to write.
Only for clarification: "Bits 12-5 should be 0x00". Should be 0x0F right? jeje
Ok, I understood, thank you very much. I must rely on the information provided by the tables.