2020-11-27 09:29 PM
Good day, I'm trying to interface the STM32F401RE with a DS3231 RTC module. The idea is to read from the time-keeping registers of the RTC module. Based on the code, I decided to set the 'hour' register to 6 and when the register is read, 6 is expected to be read. This code only works while single stepping in debug mode and not at runtime. I don't know why this is happening but if there's something I'm missing or getting wrong, I'd be glad to know.
The source code is in the attached file below.
Solved! Go to Solution.
2020-11-28 04:11 AM
Don't want to dig deep into your register level code, just one remark:
if ((I2C1->SR1 & I2C_SR1_TXE)){
This should be a while loop where the code waits spinning in that loop until transmission is completed.
2020-11-28 04:11 AM
Don't want to dig deep into your register level code, just one remark:
if ((I2C1->SR1 & I2C_SR1_TXE)){
This should be a while loop where the code waits spinning in that loop until transmission is completed.