Skip to main content
Associate
December 30, 2025
Question

I2C comunication doesn't work

  • December 30, 2025
  • 2 replies
  • 1356 views

Hello

I am trying to drive a MEMS mirror via I2C communication using the nucleo-h723zg board.

This is the clock configuration:

DannyB_2-1767105523319.png

DannyB_3-1767105553038.png

 

Then I activated the I2C1 as follow: 

DannyB_0-1767105458104.pngDannyB_1-1767105475047.png

 

I used the pins PB8 and PB9 for SCL and SDA:

DannyB_4-1767105652277.png

I'm using the DAC called MCP47x6A0T, so the address should be:

static const uint8_t DAC_Address= 0x60;

 

Then I give an input data:

static const uint8_t MEMS_Digital_Input2= 0x1C;

and then I use the function Master Transmit in the while loop:

HAL_I2C_Master_Transmit(&hi2c1, DAC_Address, MEMS_Digital_Input2, 1, HAL_MAX_DELAY);

I've this circuit connected to the microcontroller:

DannyB_5-1767106007834.png

 

Using an oscilloscope and a multimeter I'm always measuring 0V and I can't see the SCL and SDA signals.

Do you know where am I doing wrong?

Kind regards

2 replies

TDK
Super User
December 30, 2025

Does HAL_I2C_IsDeviceReady return HAL_OK? Start there. If not, here are some possibilities:

  • You're using the wrong slave address.
  • Slave is not powered.
  • Wiring is incorrect.
  • You are monitoring the wrong pins.

Slave address is shifted left 1 bit, so 0xC0 is the correct address here, not 0x60.

"If you feel a post has answered your question, please click ""Accept as Solution""."
TDK
Super User
December 30, 2025

@DannyB Did you see my reply above? Did you fix the slave address?

"If you feel a post has answered your question, please click ""Accept as Solution""."
DannyBAuthor
Associate
December 31, 2025

@TDK I fixed the slave address but nothing is changed. I've to check the HAL_I2C_IsDeviceReady function. 

Because @Andrew Neil  when I measure with the oscilloscope both signals are at 0V. So it seems I have no output signal from the microcontroller.

Andrew Neil
Super User
December 30, 2025

@DannyB wrote:

I used the pins PB8 and PB9 for SCL and SDA:


Have you checked that there's nothing on the Nucleo board already using these pins?

 


@DannyB wrote:

Using an oscilloscope and a multimeter I'm always measuring 0V and I can't see the SCL and SDA signals.


You seems to have some 3-to-5V translation going on, and at least 1 connector - so where, exactly, are you measuring?

 

The MCP4706 can work at 3V - so have you tried a direct connection?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
DannyBAuthor
Associate
December 30, 2025

I checked the pin and it should be okay.

 

On the oscilloscope Im measuring directly on the I2C connector pins. With the Multimeter Im measunig on the output voltage of the DAC, so on the resistor R3.

 

No, I didn't tried a direct connection 

Andrew Neil
Super User
December 30, 2025

@DannyB wrote:

I checked the pin and it should be okay.


You need to check two pins: PB8 and PB9

 


@DannyB wrote:

On the oscilloscope Im measuring directly on the I2C connector pins.


Which I2C connector ?

How are you connecting to the Nucleo board ?

The default is that PB8 & PB9 are not connected to the Zio headers:

AndrewNeil_1-1767109035366.png

https://www.st.com/resource/en/user_manual/um2407-stm32h7-nucleo144-boards-mb1364-stmicroelectronics.pdf#page=34

via: https://www.st.com/en/evaluation-tools/nucleo-h723zg.html#documentation

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.