Skip to main content
WM_IR
Associate III
June 12, 2022
Question

HOW TO DO BASIC MASTER SEND DATA TO SLAVE IN I2C FOR STM32F302R8

  • June 12, 2022
  • 1 reply
  • 1094 views

I need some guide on how to do the basic master send data to the slave for i2c. The question is, I need to send some data to the slave with address 0x68. Unfortunately, my start condition could not be SET and I do not know why.

here is the flow chart for basic master send data for my mcu:

0693W00000NrgBsQAJ.jpgHere is my existing code that is not working:

0693W00000NrgBxQAJ.jpg 

I hope someone can give me a clear explaination and method on what is the step by step code function that I need to write in order to get the basic master send data

This topic has been closed for replies.

1 reply

Amel NASRI
ST Technical Moderator
June 17, 2022

Hi @WM_IR​ ,

Several examples are already available under STM32CubeF3/Projects/STM32F302R8-Nucleo/Examples/I2C at master · STMicroelectronics/STM32CubeF3 · GitHub.

Try to to look to the more suitable example in your case and adapt it on your need (updating the slave address for example or used pins …).

-Amel

To give better visibility on the answered topics, please click on "Best Answer" on the reply which solved your issue or answered your question.