Skip to main content
Ocebe.1
Associate II
April 8, 2021
Solved

Hello, how can I write start,stop,address and write functions for I2C Master Mode in stm32g031k8

  • April 8, 2021
  • 5 replies
  • 1410 views

..

This topic has been closed for replies.
Best answer by Piranha

The hardware functionality and I2C state machine is described in a reference manual. Take a note that I2C is not the simplest peripheral to program. If you lack the experience, I suggest first implementing a reliable full-duplex UART driver. That is also more practical as UART can provide additional printf() style debugging. When you will have done that, you will have gained enough experience to go on and implement I2C driver. :)

5 replies

ST Technical Moderator
April 8, 2021

Hello @Ocebe.1​ ,

Have a look at the I2C examples within STM32CubeG0 MCU package, which can help you as an implementation example:

\STM32Cube_FW_G0_V1.4.1\Projects\NUCLEO-G031K8\Examples\I2C\

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
Ocebe.1
Ocebe.1Author
Associate II
April 8, 2021

Thank you, I will look.

Piranha
PiranhaBest answer
Principal III
April 8, 2021

The hardware functionality and I2C state machine is described in a reference manual. Take a note that I2C is not the simplest peripheral to program. If you lack the experience, I suggest first implementing a reliable full-duplex UART driver. That is also more practical as UART can provide additional printf() style debugging. When you will have done that, you will have gained enough experience to go on and implement I2C driver. :)

Ocebe.1
Ocebe.1Author
Associate II
April 8, 2021

Thank you for your advice , I wrote a code for printf() :grinning_face: