cancel
Showing results for 
Search instead for 
Did you mean: 

I2C Slave Address detect. how to code for other peripherals using mfx expander

vijayajangam
Associate II

Hello,

I am working with the STM32H7B3I-EVAL board

I have I2C slave model work properly the default adress used by contoller given in schematich work on 84 aand 85 adress but the other peripheral adress not get give me the roadmap for the coding of communication protocols

I2C Slave Address detect. how can i code done for other peripherals using mfx expander give me solution
 
 

didnt solve the issue.

Thank you

vijayajangam_0-1776680251260.pngvijayajangam_1-1776680258467.png

 

2 REPLIES 2
Khaled_DHIF
ST Employee

Hello @vijayajangam ,

0x84 and 0x85 are not two different device addresses. They are the write/read forms of the same 7-bit I2C slave address, 0x42. In STM32 HAL, you normally pass the 7-bit address shifted left by 1, so 0x42 becomes 0x84.

The MFX expander is an I2C slave device itself. It does not detect, translate, or proxy other I2C slave addresses. To communicate with other peripherals, you must address each peripheral directly using its own I2C address from the board schematic or datasheet.

Recommended roadmap:

  1. Identify each peripheral’s 7-bit I2C address.
  2. Shift it left by 1 for STM32 HAL.
  3. Check device presence with HAL_I2C_IsDeviceReady().
  4. Access registers with HAL_I2C_Mem_Read() / HAL_I2C_Mem_Write().

Kind regards, 

DHIF Khaled

 

Please mark my answer as best by clicking on the “Accept as solution" button if it fully answered your question. This will help other users find this solution faster.​

And to add :

> Recommended roadmap: ...

Consult the I2C specification, which is freely available on the internet.

> I have I2C slave model work properly the default adress used by contoller given in schematich work on 84 aand 85 adress

The idea to have a separate I2C_ADDR pin is obviously to "add" this bit to the default address, depending on it being pulled high or low. But needs to be done in your firmware.