RTC_NXP_Arduino 0.4.0
LED driver device operation sample code for Arduino
|
RTC device operation sample code for Arduino
Note
This library works with I2C_device
library together. Please be sure the I2C_device
library is imported in your environment before trying to build.
PCF2131-ARD, PCF85063TP-ARD, PCF85063AT-ARD and PCF85263ATL-ARD : Arduino® Shield Evaluation Board for RTCs
An Arduino library for RTC devices with its sample code.
A method of time()
in each RTC device classes are cpmpatible to time()
function in 'time.h'. The method is defined as same as time_t time( time_t* tp )
.
It returns a value in the systems time stamp format of 'time.h'.
To display the calendar/time, it can be written in this way.
PCF2131, PCF85063A, PCF85063TP and PCF85263A are supported.
On PCF2131, both I²C and SPI can be used for interfacing MCU. Include device name header file (PCF85063A.h
, PCF85063TP.h
, PCF85063TP.h
and for PCF2131, PCF2131_I2C.h
, PCF2131_SPI.h
) to use those class libraries.
Type# | Header file | Features | Interface | Evaluation board |
---|---|---|---|---|
PCF2131 | PCF2131_I2C.h PCF2131_SPI.h | Nano-Power Highly Accurate RTC with Integrated Quartz Crystal | I²C and SPI | PCF2131/PCA2131 Arduino® Shield Evaluation Board |
PCF85063A | PCF85063A.h | Tiny Real-Time Clock/Calendar with Alarm Function | I²C | PCF85063AT-ARD Arduino® Shield Evaluation Board |
PCF85063TP | PCF85063TP.h | Tiny Real-Time Clock/Calendar | I²C | PCF85063TP-ARD Arduino® Shield Evaluation Board |
PCF85263A | PCF85263A.h | Tiny Real-Time Clock/Calendar with Alarm Function, Battery Switch-Over, Time Stamp Input | I²C | PCF85263ATL-ARD Arduino® Shield Evaluation Board |
Use Library manager in Arduino IDE for easy install
Examples are provided as scketch files.
After library install, Choose menu on Arduino-IDE: File
→Examples
→RTC_NXP_Arduino
→ sketch for your try
Sketch | Target | Feature |
---|---|---|
PCF2131_simple_I2C | PCF2131 | Simple sample for just getting current time via I²C in every second |
PCF2131_simple_SPI | PCF2131 | Simple sample for just getting current time via SPI in every second |
PCF2131_interrupt_based_operation | PCF2131 | Interrupt based operation: Demonstrates second/minute, alarm and timestamp features. IMPORTANT: On the PCF2131-ARD shield board, short D8<-->D2 and D9<-->D3 pins |
PCF85063A_simple | PCF85063A | Simple sample for just getting current time via I²C in every second |
PCF85063A_interrupt_based_operation | PCF85063A | Interrupt based operation: Demonstrates timer and alarm features |
PCF85063TP | PCF85063TP | Simple sample for just getting current time via I²C in every second |
PCF85263A_simple | PCF85263A | Simple sample for just getting current time via I²C in every second |
PCF85263A_interrupt_based_operation | PCF85263A | Interrupt based operation: Demonstrates using 2 interrupt lines |
PCF85263A_timestamp | PCF85263A | Timestamp operation: Demonstrates timestamp feature |
For details of the library, please find descriptions in this document.
Library | Feature | Target devices | Required library |
---|---|---|---|
GPIO_NXP_Arduino | LED driver libraries | PCAL6408A, PCAL6416A, PCAL6524, PCAL6534 | I2C_device_Arduino |
LEDDriver_NXP_Arduino | LED driver libraries | PCA9955B, PCA9956B, PCA9957 | I2C_device_Arduino |
RTC_NXP_Arduino | RTC driver libraries | PCF2131, PCF85063A | I2C_device_Arduino |
TempSensor_NXP_Arduino | Temperature sensor libraries | LM75B, PCT2075, P3T1085 | I2C_device_Arduino |
I2C_device_Arduino | Base library for I²C operations | none (can be applied as base class for all I²C targets) | — |