Skip to content

Commit 5ae23e5

Browse files
pyhyshenrikbrixandersen
authored andcommitted
boards: shields: Add Adafruit PCF8523 real-time clock shield
Product image from https://learn.adafruit.com/assets/103710 Tested with the command mentioned in the index.rst file. Compile-testing of the overlay file is done in CI via the drivers/rtc sample. Signed-off-by: Jonas Berg <[email protected]>
1 parent d5b90a7 commit 5ae23e5

File tree

6 files changed

+103
-0
lines changed

6 files changed

+103
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2025 Jonas Berg
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SHIELD_ADAFRUIT_PCF8523
5+
def_bool $(shields_list_contains,adafruit_pcf8523)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2025 Jonas Berg
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/ {
8+
aliases {
9+
rtc = &adafruit_pcf8523;
10+
};
11+
};
12+
13+
&zephyr_i2c {
14+
status = "okay";
15+
16+
adafruit_pcf8523: pcf8523@68 {
17+
status = "okay";
18+
compatible = "nxp,pcf8523";
19+
reg = <0x68>;
20+
battery-switch-over = "standard";
21+
};
22+
};
44.8 KB
Loading
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
.. _adafruit_pcf8523:
2+
3+
Adafruit PCF8523 Shield
4+
#######################
5+
6+
Overview
7+
********
8+
9+
The `Adafruit PCF8523 Real Time Clock Shield`_ features
10+
an `NXP PCF8523 Real-Time clock`_ and two Qwiic connectors.
11+
It has a CR1220 3 Volt back-up coin-cell battery.
12+
13+
.. figure:: adafruit_pcf8523.webp
14+
:align: center
15+
:alt: Adafruit PCF8523 Shield
16+
17+
Adafruit PCF8523 Shield (Credit: Adafruit)
18+
19+
20+
Requirements
21+
************
22+
23+
This shield can be used with boards which provide an I2C connector, for
24+
example STEMMA QT or Qwiic connectors.
25+
The target board must define a ``zephyr_i2c`` node label.
26+
See :ref:`shields` for more details.
27+
28+
29+
Pin Assignments
30+
===============
31+
32+
+--------------+----------------------------------------------------------+
33+
| Shield Pin | Function |
34+
+==============+==========================================================+
35+
| SDA | PCF8523 I2C SDA. Also connected to the Qwiic connector. |
36+
+--------------+----------------------------------------------------------+
37+
| SCL | PCF8523 I2C SCL. Also connected to the Qwiic connector. |
38+
+--------------+----------------------------------------------------------+
39+
| SQW | PCF8523 INT/CLK interrupt output or square wave output |
40+
+--------------+----------------------------------------------------------+
41+
42+
To use the interrupt output from the PCF8523, you need to connect a wire from
43+
the shield SQW output to a suitable GPIO on your microcontroller board, and to
44+
modify the devicetree settings. See :dtcompatible:`nxp,pcf8523` for options.
45+
46+
47+
Programming
48+
***********
49+
50+
Set ``--shield adafruit_pcf8523`` when you invoke ``west build``. For example
51+
when running the :zephyr:code-sample:`rtc` sample:
52+
53+
.. zephyr-app-commands::
54+
:zephyr-app: samples/drivers/rtc
55+
:board: adafruit_qt_py_rp2040
56+
:shield: adafruit_pcf8523
57+
:goals: build
58+
59+
.. _Adafruit PCF8523 Real Time Clock Shield:
60+
https://learn.adafruit.com/adafruit-pcf8523-real-time-clock
61+
62+
.. _NXP PCF8523 Real-Time clock:
63+
https://www.nxp.com/products/analog-and-mixed-signal/real-time-clocks/100-na-real-time-clock-calendar-with-battery-backup:PCF8523
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
#
3+
# Copyright (c) 2025, Jonas Berg
4+
5+
shield:
6+
name: adafruit_pcf8523
7+
full_name: Adafruit PCF8523 Real Time Clock Shield
8+
vendor: adafruit
9+
supported_features:
10+
- rtc

samples/drivers/rtc/sample.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ tests:
2323
sample.drivers.rtc.shields:
2424
platform_allow:
2525
- adafruit_qt_py_rp2040/rp2040
26+
- adafruit_metro_rp2040/rp2040
2627
integration_platforms:
2728
- adafruit_qt_py_rp2040/rp2040
29+
- adafruit_metro_rp2040/rp2040
2830
extra_args:
2931
- platform:adafruit_qt_py_rp2040/rp2040:SHIELD="sparkfun_rv8803"
32+
- platform:adafruit_metro_rp2040/rp2040:SHIELD="adafruit_pcf8523"

0 commit comments

Comments
 (0)