How to connect an Arduino to a STM32F4 evaluation board

arduinostm32

I have a few Arduino and sensors on Arduino shields. I also have a STM32F4 Discovery evaluation board. For a hobby project, I have a feature on an Arduino (Ethernet port on my EtherMega) that I would like to use from the STM32. The STM32 can generate VGA signal, but needs a connection to my local network.

How can I transfer information between these two boards, and what additional components are required ?

Best Answer

The easiest solution would most likely involve an I2C connection between the two boards. I'm not familiar with the EtherMega, but I know the STM32F4-Discovery has several I2C pins available. You could then let the Arduino handle the network protocol, and only shift the relevant information over to the STM. Whether or not this will be fast enough for your purpose, I cannot say.

The only thing you need in terms of extra components is a way of level-shifting the (presumably) 5V of the Arduino to the 3.3V of the STM32F4-Discovery. For I2C a simple solution is to use an n-channel mosfet with two pull-up resistors per line (SDA, SCL - so 2 mosfets and 4 resistors in total). Philips/NXP has a very nice application note on this, specifically for I2C, available here:

http://ics.nxp.com/support/documents/interface/pdf/an97055.pdf