2022-06-27 10:25 AM
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ł
Solved! Go to Solution.
2022-06-29 01:11 AM
@PReka.2 "Is it ok to use inernal pullups to I2C communications?"
As noted earlier, they will generally be too weak - but you might "get away" with it ...
A thread on I2C pullups:
In that thread, this picture shows the effects of the pullup value:
Note that marking a solution doesn't close the thread - further replies can still be added.