Hi.
I want to use time and data from rtc module based on ds1302 chip like in picture below:
I know there is Xod library for rtc module but its for i2c comunication. But module that i have is called 3 wire comunication. It has 5 pins: VCC, GND, CLK, DAT, and RST.
I load your library and try it on two different boards, Nano and Uno, but still cant get any data from RTC module. However it works with sketch from link via Arduino IDE, so the module itself is fine.
When left button is pressed and released, to set data and hour, it change its status from false to true,and back to false, just like supposed to. When right button is pressed to read data, it change its status from false to true, but when its released its looks like its freeze all debug mode, and its stay true, even the button is released. Rtc-ds node show “00-00-00”, rtc-wds show “watch”, and rtc-ds show “00:00:00”.
I use tobias/plc library to format data from module. But there is problem with year and weekday. Year, instead “2020” is “55”, and weekday instead “SUN” ( sunday, which is seventh day of week) is “SAT”.
Hi. What I will say now is more a question than an answer. I don’t have a sensor, and I don’t have the ds1302 and tobias / plc libraries, but why can’t I set a date (without a sensor) in some patch, and after every second add one to this patch? The Patch itself will have functions to convert seconds to minutes, minutes to hours, hours to days, etc (ships everywhere, the cesars/ds1302 library works like that).
The question is: Why do i need a sensor, if using programming it is possible to calculate the time anyway? As I understand it, the only thing, that the sensor can do is work without an arduino board connected to the power supply (using battery), right?
My guess would be that day of week is using 1 for Monday, but rtc-wds is an nth-input which starts at zero, so you need to add an extra pin in front of Monday.
Looks like first day of the week is different around the world. I’m from Poland, and here, in every calendar I’ve seen, Monday is first . But for example in Google Calendar app you can choose which day is first.
Now i have proper weekday on display, but still year is “55” instead “2020”.
Sounds like RTC may need 1965 added to the year. There could be something else wrong that this would only be a kludge to cover up the problem, though… 1965 is an odd year to be the “epoch”…
Hi, It is one of my first libraries, which I modified later but there were errors.
Eliminate the internal debug, you should be able to simulate now, the error of the year is because I put 2020 and according to the datasheet the year record of the RTC is from 00 to 99.
hence the error and the need to add 1965.