cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F0 I2C Example code

kasun_duminda92
Associate III
Posted on July 26, 2013 at 04:06

I have been trying to make a slave I2C device communicate with my STM32F0 board, with no success. Can anyone give me an example code to config, init and send and receive data through the I2C bus.

15 REPLIES 15
vikramtathe007
Associate
Posted on March 10, 2016 at 13:15

Thanks

saiyaswanth97
Associate II
Posted on June 11, 2016 at 16:58

saiyaswanth97
Associate II
Posted on June 11, 2016 at 17:02

What is the i2c address of RTC

Posted on June 11, 2016 at 17:12

Let's try and think this through and supply enough detail in the question so people not inside your head can figure out what you're using?

Which RTC chip are you using?

What does the Data Sheet for the RTC say?

What specific STM32 part are you attempting to attach this too?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
saiyaswanth97
Associate II
Posted on June 11, 2016 at 17:18

The address of RTC in this code.

Sorry for the before post.

Thanks in advance.

Posted on June 11, 2016 at 22:57

The

http://datasheets.maximintegrated.com/en/ds/DS1307.pdf

specifies the address as 0x68, so in this context (0x68 << 1) for the high order 7-bits used by the STM32

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..