I2C problem. I can't get the communication to work on STM32F0 Discovery in STM32CubeIDE. Where is the error in reasoning?
Hello, I tried to run the RTC DS1307 first using libraries available on the internet. It was not successful. Later I tried to run the communication "manually" but it doesn't work either. Please help.
The module with DS1307 works on Arduino. Through the Arduino I have set the output from the SQW Pin to flash every 1 Hz. Using STM I try to disable this function by typing
HAL_I2C_Mem_Write(&hi2c1, 0x68<<1, 0x07, 1, 0x00, 1, 1000);
but nothing happens. Please help me because I can't stand it anymore.
To sum up:
1 . I set configuration:
2 . Generate the code via Cube.
3 . Add one line of code:
/* USER CODE BEGIN 2 */
HAL_I2C_Mem_Write(&hi2c1, 0x68<<1, 0x07, 1, 0x00, 1, 1000);
/* USER CODE END 2 */
and LED connected to SQW output of DS1307 is still blinking after uplode code to STM32F0 Discovery. What I do wrong?
Sincerely
Paweł
