is it possible to connect two I2C busses on one board, one at master mode and the other in slave. I am just trying to learn some I2C stuff, but I have only one board.
1 Answer 1
Yes.
The ST Micro STM32F429 datasheet says it has three I2C peripherals, so as long as the pins are available, you can connect them together, and use one as a master and the other as a slave.
If the pins of all three I2C peripherals are available, you could connect all three, and do a bunch of experiments to learn how to use I2C in multi-slave and multi-master configurations.
You should be quite careful about how interrupts are used. However, you can probably ignore using more than one interrupt, and still learn a lot.
There is an STM32F429-Discovery development board. If you are using that there are libraries to drive the peripherals. One is the older CMSIS-based STM32F429-Discovery Firmware, another is STM32CubeF4.
There are a bunch of low cost I2C slave devices. As suggested in the comments, there are I2C EEPROM chips, and I've used low-cost I2C temperature sensors (under one GCP), to test software.
-
\$\begingroup\$ As above, yes. However, I2C EEPROMs are pretty cheap and they are a known-working device so when you're debugging and it doesn't work, you know who to blame ;) I would not like to start from scratch implementing both endpoints, though you can certainly work towards that point with all three I2C peripherals connected together. \$\endgroup\$William Brodie-Tyrrell– William Brodie-Tyrrell2016年01月19日 12:52:52 +00:00Commented Jan 19, 2016 at 12:52