i2c communication between two different stm32 evk boards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-18 5:36 AM
Hi everyone, I am trying to learn i2c communication between two stm32 microcontrollers. I am using stm32f407g Disk1 board as slave and stm32l100 disco as master I configured these boards I have provided source files below.
can you give any suggestions what i need to add or how i can able to communicate?
Thank you.
- Labels:
-
STM32F4 Series
-
STM32L1 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-18 5:42 AM - edited ‎2024-12-18 5:42 AM
Hello @Tharun123
I advise you start from this wiki article which explains -step by step- how to configure I2C to communicate between two boards and how to use I2C through examples: Getting started with I2C - stm32mcu
This FAQ may help you with tips related to I2C peripheral: STM32 I2C does not work - STMicroelectronics Community
Thanks
Imen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-18 8:25 AM - edited ‎2025-01-31 7:24 AM
@Tharun123 wrote:Hi everyone, I am trying to learn i2c communication between two stm32 microcontrollers..
I would suggest that's not a great way to learn!
That means you have to implement both the slave and the master on the two separate MCUs.
The trouble is that, when you get problems, you then don't know:
- Is the problem in the Master?
- Is the problem in the Slave?
- Are there problems in both Master and Slave?
A far better approach is to start with just one end of the link, and use a well-known, standard device at the other end to test against.
As by far the commonest (therefore, best supported) use case is to have the microcontroller as the Master, I would suggest that you start there.
Something like this provides some good test devices for your Master implementation:
https://www.microchip.com/en-us/development-tool/pkserial-i2c1
In developing your master, be sure to test it under common fault conditions; eg,
- Missing slave device
- One wire disconnected
- Pullups missing
Get to understand how it behaves in such conditions.
Understand what good and bad signals look like on an oscilloscope.
Provide good diagnostics to give visibility of what's happening.
Then, once you have your master working well, you can start to develop a Slave to work with it.
I2C References:
The I2C-bus Specification and User Manual: https://www.nxp.com/docs/en/user-guide/UM10204.pdf
https://en.wikipedia.org/wiki/I%C2%B2C
https://learn.sparkfun.com/tutorials/i2c/all
#BothEnds #I2CBothEnds
A complex system designed from scratch never works and cannot be patched up to make it work.
