Register-Based Programming for STM32F4’s
This is a series of 10 projects writing drivers for STM32F401RE. These drivers can be used with slight modification for any STM32F4 family. Initially I was implementing these on a STM32F407, but that board has departed this world now.
For now I have my latest progress posted here. When I take videos of the earlier work, I will upload that as well.
I have linked a google drive folder here containing all of the resources I use as I update this page. The reference sheet and data sheets can be found there.
I2C:
The main file configures a timer (1us/cycle), system clock using external crystal at max frequency (84Mhz), and UART (115200 baud rate). It then configures I2C (100kHz, so standard mode) and sends out a repeating cycle of turning on each LED one at a time with a 300ms delay provided by the timer driver. It also repeatedly sends, via UART to RealTerm serial, that we’ve sent the start, stop, and address commands as well as if they were successful.
The red LEDs are difficult to see due to their threshold voltage being relatively high compared to the blue and clear LED; however, it faintly turns on.