Using the realtime clock of the STM32 to display the date and time value and an I²C display.
- Use the Real-Time-Clock RTC of the STM32
- Display the time every second in the format
TT:MM - HH:MM:SS
- Using the UART, the time can be modified
- NUCLEO-F413ZH
- Freenove LCD1602
- sets the RTC with UART
- checks the time input from UART
- checks the date input from UART
- uses interrupts to receive input
-
does not require to type the symbols:
and-
- considers leap years
- document and beautify RTC code
- uses interrupt to synchronize RTC value to the display
- only synchronize data every second
- use RTC alarm interrupt instead of timer interrupt
- initializes display
- use the I²C-2 and set to 100kHz clock frequency (max rating of display)
- connect
PB -> SDA
,PB9 -> SCL
, GND and a supply voltage of 5V - I²C communication error lights up the red onboard led
- check and document initialisation and transfer code
HAL_I2C_Transmit is expensive because of decreased I²C speed of the display!
- send all characters to the display in one HAL_I2C_Transmit call
- use asynchronous transmit to transfer the data to the display
-
only transfer changed chars