Difference: PCF8563Driver (1 vs. 4)

Revision 42021-01-27 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="TheT-watch2020Hardware"

The Driver for the PCF8563 Real-time Clock and Calendar

Line: 22 to 22
 
  • enable_alarm_interrupt(): enable the alarm interrupt
  • disable_alarm_interrupt(): disable the alarm interrupt
  • set_daily_alarm(hours=None, minutes=None, date=None,weekday=None)
Changed:
<
<
I had some difficulties with the sequence of parameters of datetime(), set_datetime() and write_all() which did not reflect the sequence returned by utime.localtime which is
(year,month,date,hours,minutes,seconds,day_of_week). I therefore the parameters of these methods.
>
>
I had some difficulties with the sequence of parameters of datetime(), set_datetime() and write_all() because it did not reflect the sequence returned by utime.localtime, which is
(year,month,date,hours,minutes,seconds,day_of_week). I therefore modified the driver and changed the parameters of these methods.
  Then I wrote 2 example programs:
  • rtc_set_time: Sets the time to the current CET time (you can easily modify this to set e.g. GMT time instead)

Revision 32021-01-26 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="TheT-watch2020Hardware"

The Driver for the PCF8563 Real-time Clock and Calendar

Changed:
<
<
This is a pure MicroPython driver written by Lewis He, which can be found on https://github.com/lewisxhe/PCF8563_PythonLibrary.
>
>
This is a pure MicroPython driver written by Lewis He, which can be found on https://github.com/lewisxhe/PCF8563_PythonLibrary
  It is implemented as class PCF8563 with the following methods:
  • PCF8563(i2c:!I2C,address=None): Creates an PCF8563 instance. In the first parameter the I2C object from the machine module must be passed. address can be left undefined in which case the default PCF8563 I2C slave address (0x51) is used
Line: 13 to 13
 
  • date(): returns day in the month
  • month(): returns months
  • year(): returns year
Changed:
<
<
  • datetime(): returns the tuple: (year,month,date,day,hours,minutes,seconds)
  • write_all(seconds=None,minutes=None,hours=None,day=None,date=None,month=None,year=None): writes the corresponding value to the pcf8563 registers if not None)
  • set_datetime(dt): dt is a tuple (year, month,date,day,hours,minutes,seconds)
>
>
  • datetime(): returns the tuple: (year,month,date,hours,minutes,seconds,day)
  • write_all(year=None,month=None,date=None,hours=None,minutes=None,seconds=None,day=None): writes the corresponding value to the pcf8563 registers if not None)
  • set_datetime(dt): dt is a tuple (year, month,date,hours,minutes,seconds,day)
 
  • write_now(): write utime.localtime() to the PCF8563 registers
  • set_clk_out_frequency(frequency=CLOCK_CLK_OUT_FREQ_1_HZ): sets the clock out pin frequency (1 Hz if frequency is not specified)
  • check_for alarm_interrupt() check i the alarm interrupt is set
  • enable_alarm_interrupt(): enable the alarm interrupt
  • disable_alarm_interrupt(): disable the alarm interrupt
  • set_daily_alarm(hours=None, minutes=None, date=None,weekday=None)
Added:
>
>
I had some difficulties with the sequence of parameters of datetime(), set_datetime() and write_all() which did not reflect the sequence returned by utime.localtime which is
(year,month,date,hours,minutes,seconds,day_of_week). I therefore the parameters of these methods.

Then I wrote 2 example programs:

  • rtc_set_time: Sets the time to the current CET time (you can easily modify this to set e.g. GMT time instead)
  • rtc_get_time: Gets date and time from the PCF8563
You can find the code on the github repository: https://github.com/uraich/twatch2020_firmware/tree/main/hardware/pcf8563
  -- Uli Raich - 2021-01-25

Revision 22021-01-25 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="TheT-watch2020Hardware"

The Driver for the PCF8563 Real-time Clock and Calendar

Changed:
<
<
This is a pure MicroPython driver written by Lewis He which can be found on https://github.com/lewisxhe/PCF8563_PythonLibrary.
>
>
This is a pure MicroPython driver written by Lewis He, which can be found on https://github.com/lewisxhe/PCF8563_PythonLibrary.
 
Changed:
<
<
It is implemented as class PCF8563 with the following methods:
>
>
It is implemented as class PCF8563 with the following methods:
  • PCF8563(i2c:!I2C,address=None): Creates an PCF8563 instance. In the first parameter the I2C object from the machine module must be passed. address can be left undefined in which case the default PCF8563 I2C slave address (0x51) is used
  • seconds(): returns seconds of current time
  • minutes(): returns minutes
  • hours() returns hours
  • day(): returns day of the week
  • date(): returns day in the month
  • month(): returns months
  • year(): returns year
  • datetime(): returns the tuple: (year,month,date,day,hours,minutes,seconds)
  • write_all(seconds=None,minutes=None,hours=None,day=None,date=None,month=None,year=None): writes the corresponding value to the pcf8563 registers if not None)
  • set_datetime(dt): dt is a tuple (year, month,date,day,hours,minutes,seconds)
  • write_now(): write utime.localtime() to the PCF8563 registers
  • set_clk_out_frequency(frequency=CLOCK_CLK_OUT_FREQ_1_HZ): sets the clock out pin frequency (1 Hz if frequency is not specified)
  • check_for alarm_interrupt() check i the alarm interrupt is set
  • enable_alarm_interrupt(): enable the alarm interrupt
  • disable_alarm_interrupt(): disable the alarm interrupt
  • set_daily_alarm(hours=None, minutes=None, date=None,weekday=None)
  -- Uli Raich - 2021-01-25

Revision 12021-01-25 - UliRaich

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="TheT-watch2020Hardware"

The Driver for the PCF8563 Real-time Clock and Calendar

This is a pure MicroPython driver written by Lewis He which can be found on https://github.com/lewisxhe/PCF8563_PythonLibrary.

It is implemented as class PCF8563 with the following methods:

-- Uli Raich - 2021-01-25

Comments

<--/commentPlugin-->
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback