Skip to main content
HReet
Associate
Sep 23, 2020 9:54 AM UTC
Solved

Sending data via I2C doesnt work properly

Hi,

I want to controll a ST7032 Display Modul via I2C with a STM32G071G8 MCU. Unfortunately I can't manage to send data bytes to the Display. For sending data I use the HAL function HAL_I2C_Master_Transmit() as followed: (for testing)

HAL_I2C_Master_Transmit(&hi2c1, 0x7C<<1, buffer, sizeof(buffer), 1);
HAL_Delay(1000);

where buffer is an array with two uint8_t values.

The code above is looped every second for testing because I cant see data transmitted on the line. The following picture shows what can be seen.

0693W000004GpfxQAC.png

The Display controller seems to ACK the Adress but the MCU stops to send data.

Does anybody knows the mistake?

thanks for your support!

Henning

This topic has been closed for replies.
HReet
HReetBest answer
Associate
Sep 23, 2020 10:06 AM UTC

Solved it!

Missunderstood the datasheets adress information. Shifting the slaves adress is not necessary. So now I'm able to send data.

2 replies

waclawek.jan
Super User
Sep 23, 2020 10:02 AM UTC

Cube is open-source so you can debug it as your own code.

JW

HReet
HReetAuthorBest answer
Associate
Sep 23, 2020 10:06 AM UTC

Solved it!

Missunderstood the datasheets adress information. Shifting the slaves adress is not necessary. So now I'm able to send data.