Everything works in PowerPoint; but if you have the physical item or some demonstration software, that’s much more convincing to people than a PowerPoint presentation or a business plan.
— Elon Musk
This short article discusses the practical implementation of the series, Get your Linux computer to communicate with a microcontroller. In the first article[1] of the series, the I2C communication protocol and the system architecture of the integrated system involving a Linux computer and a microcontroller was presented. In the second article[2], the implementation in the STM32 microcontroller is carried out and the code was discussed and it was followed by a third article[3] explaining the implementation of the Linux kernel module aka Linux driver.
As the focus of this article series to explain the communication a multiclock system, the schematics for this project has been kept as simple as possible. The Linux computer pertinent to this article series is a Raspberry Pi 3 and the microcontroller is an STM32 development board NucleoH723ZG. The schematic of this is project is shown in Figure 1.
Figure 1. Connections between Raspberry pi and STM32 microcontroller
The visual presentation shows two parallel videos captured at the same time, the Raspberry Pi’s command line and the development board. As it can be observed, initially the LED blinks at a frequency of 5 Hz. Then 2 is written to the device file /dev/stm32 and the LED starts to blink at 1 Hz. Followed by that, 10 and 1 is written to the device file through various applications and it can be visually perceived that the LED’s blinking frequency changes accordingly.
This article showed the implementation a simple integrated system involving multi-clock systems with the establishment of communication through I2C protocol. The code for the project can be found in the github repository[4].
[3] https://www.linkedin.com/pulse/part-3-linux-driver-get-your-computer-communicate-christopher-jft3e
[4] https://github.com/rocheparadox/simple-integrated-system/