Help determining I2C slave device address - Page 1
Forum section: electronics / beginners

author: bhj99
author_rank: Contributor
timestamp: September 02, 2023, 11:55:31 pm
content: Hi all, could anyone help me with determining the I2C slave address for this GPIO expander chip (schematic snippet attached)? Trying to learning I2C basics. Looking through this long datasheet, it seems like it is 0x44H, or I am I totally off track. Also, if anyone can share general approached to determining I2C addresses based on the datasheet, I'd appreciate it.

author: ataradov
author_rank: Super Contributor
timestamp: September 03, 2023, 12:07:08 am
content: With ADDR connected to the ground, the 8-bit I2C address would be 0x44 according to the datasheet.There is no general approach, different devices use slightly different methods of setting the address, so you just have to read the description in each case.In most cases there is a fixed part and a variable part. The whole address may be fixed, of course. If there is a variable part, then it is often just mapped to the address pins.In this case they use 4 possible connections of the ADDR pin to define two variable bits of the address, allowing up to 4 devices on the same bus.

author: ataradov
author_rank: Super Contributor
timestamp: September 03, 2023, 01:30:53 am
content: This is not correct. 0x44 is 8-bit address, so it is either 0x44 (W) or 0x45 (R).

author: DavidAlfa
author_rank: Super Contributor
timestamp: September 03, 2023, 03:16:38 am
content: Correct! It's very common for datasheets to use the 7bit address so I assumed wrong this timeDeleted the message!

author: rstofer
author_rank: Super Contributor
timestamp: September 03, 2023, 04:13:26 pm
content: From a software point of view, the address can be 0x40, 0x42, 0x44 or 0x46 according toTable 4.But there's only 1 address pin, how do they get 4 addresses? By connecting the ADDR pin to either SCL, SDA, Vss or Vdd according to Table 4.https://www.nxp.com/docs/en/data-sheet/PCAL6524.pdfYou do not need to shift the bits 1 position to the left with this scheme. Just mask in the R/W' bit to position 0 and you are good to go. See Figure 4.This is where I enable I2C on a Raspberry Pi and use the 'lsi2c' utility to find out what is where on the I2C bus.Kind of an unusual addressing scheme! The datasheet is quite clear on how this works and what needs to be sent down the wire.

author: bhj99
author_rank: Contributor
timestamp: September 07, 2023, 07:13:51 pm
content: Quote from: ataradov on September 03, 2023, 12:07:08 amThanks for the help for begineers like me. it makes sense now. I now would like to connect an Aardvark I2C/SPI Host Adapter for read/write via I2C and the GPIO Control menu options avaiable on the Total Phase Control Center Serial tool. I was wondering if you could explain how to configure the logic level for the indivdual I/O ports. For example, if I wanted to write logic 0 (i.e. pull low) to the SFP0_3.3V_EN signal (P0_6, pin 7 of schematic), what command/message (0x0Ch ?) should I be writing to the slave address 0x44?

author: ataradov
author_rank: Super Contributor
timestamp: September 07, 2023, 07:45:27 pm
content: You would first need to write corresponding Configuration register (0x0C for P0). Clear the bits that you want to become outputs. Then write Output port register (0x04 for P0) with the value you want to see on the pin.The write happens in 2 bytes - register address and register value. So, the "message" field would look like "0C BF" (set only P0.6 to output), and then "04 40" to set it high and "04 00" to set it low.Also, keep in mind that Aardvark uses 7-bit address, so you need to use address 0x22.There does not seem to be a way to set/clear individual pins, so you have to set the whole port state. If you don't want some pins to change, you just need to write the same value.