martinberlin / bistable-smart-switch

An epaper switch project with 2 PCBs, controller+touch, and 220AC to 3DC with Relay (Latch or solid-state)
http://fasani.de
Apache License 2.0
29 stars 2 forks source link

PCF8563 version ESP32-C3 #9

Closed martinberlin closed 1 year ago

martinberlin commented 1 year ago

This version has lower end NXP's PCF8563 that will count per minute instead of per second (Strangely: Does not have a second alarm) UPDATE: Yes of course has one. And is not only seconds, has also a divisor as 2nd argument, so you can do a set_timer(&i2c, 1HZ, 2) and it will tick 2 times per second.

Datasheet PCF8563 Reference library Lewis Xhe as much as I respect Lewis his library its not cool and I am sure he never tested all the functions properly. Discarded.

Related to PR: https://github.com/martinberlin/esp-idf-pcf8563/pull/2

Example:

  //                                FREQ, Divisor   (Ex 64HZ, 64 will also tick per second)
  pcf8563_set_timer(&dev, PCF8563_CLK_1HZ, 1);
martinberlin commented 1 year ago

@goran-mahovlic now PCF8563 version is working per second just the same as DS3231. Just with a 7 times cheaper RTC :) Take a look when you have some time and tell me if this would be OK to merge it in master