2025-12-30 6:51 AM
Hello
I am trying to drive a MEMS mirror via I2C communication using the nucleo-h723zg board.
This is the clock configuration:
Then I activated the I2C1 as follow:
I used the pins PB8 and PB9 for SCL and SDA:
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:
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
2025-12-30 7:06 AM
Does HAL_I2C_IsDeviceReady return HAL_OK? Start there. If not, here are some possibilities:
Slave address is shifted left 1 bit, so 0xC0 is the correct address here, not 0x60.
2025-12-30 7:15 AM
@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?
2025-12-30 7:25 AM
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
2025-12-30 7:37 AM
@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:
via: https://www.st.com/en/evaluation-tools/nucleo-h723zg.html#documentation
2025-12-30 8:10 AM
The I2C connector on the PCB (called H2 on the schematic).
I'm connecting the nucleo board on my PC using the USB cable to the USB PWR on the board and 2 cables from the pins PB8 (which is D15-SCL) and PB9 (which i D14-SDA) on the CN7 connector to the PCB (component H2 on the schematic).
I'm giving the digital value from the microcontroller to the external DAC. So it's right that it's not connected to CN9 or am I wrong?
2025-12-30 8:32 AM
Not clear what you mean by "the PCB" and "the board"?
A Nucleo is a "board" aka a "PCB"; presumably, your MCP4706 is on a separate PCB?
You've only shown a tiny part of the MCP4706 board.
Please show a block diagram (or schematic) of the complete system.
How to write your question to maximize your chances to find a solution