cancel
Showing results for 
Search instead for 
Did you mean: 

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

WM_IR
Senior

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

1 REPLY 1
Amel NASRI
ST Employee

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 Accept as Solution on the reply which solved your issue or answered your question.