PCF2127 and PCF2129 are high accuracy real-time-clock (RTC) module. This library provides simple interface to accessing clock information.
Dependents: PCF2127_Demo PCF2127_Hello
PCF2127 and PCF2129
PCF2127T is in SO16 package
The PCF2127 and the PCF2129 are a CMOS Real Time Clock (RTC) and calendar with an integrated Temperature Compensated Crystal (Xtal) Oscillator (TCXO) and a 32.768 kHz quartz crystal optimized for very high accuracy and very low power consumption.
Both of PCF2127 and PCF2129 have a selectable I2C-bus or SPI-bus, a backup battery switch-over circuit, a programmable watchdog function, a timestamp function, and many other features.
On addition to this, the PCF2127 has 512 bytes of general-purpose static RAM.
These 4 types of RTC modules are software compatible. So this library "PCF2127" can be used all of those.
This library only supports I2C to communicate with the PCF2127/PCF2129.
Type variations
Main feature difference
type | +/-3ppm accuracy range | 512 bytes RAM | package |
---|---|---|---|
PCF2127T | -30℃ to +80℃ | yes | SO16 |
PCF2127AT | -30℃ to +60℃ | yes | SO20 |
PCF2129T | -30℃ to +80℃ | not available | SO16 |
PCF2129AT | -15℃ to +60℃ | not available | SO20 |
Pin assign
PCF2127T
Connection between MCU and PCF2127/PCF2129
These examples show how the RTC module can be connected via I2C bus.
References
- Datasheet
- User manual
- Other information PCF2127
Revision 3:e2a6ac61fcbd, committed 2014-12-10
- Comitter:
- nxp_ip
- Date:
- Wed Dec 10 02:07:35 2014 +0000
- Parent:
- 2:db76c68f998f
- Commit message:
- online document (class description) updated
Changed in this revision
PCF2127.cpp | Show annotated file Show diff for this revision Revisions of this file |
PCF2127.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r db76c68f998f -r e2a6ac61fcbd PCF2127.cpp --- a/PCF2127.cpp Wed Dec 10 01:43:30 2014 +0000 +++ b/PCF2127.cpp Wed Dec 10 02:07:35 2014 +0000 @@ -2,7 +2,7 @@ * PCF2127 library * * @author Akifumi (Tedd) OKANO, NXP Semiconductors - * @version 1.7 + * @version 1.8 * @date 10-Dec-2014 * * PCF2127 is a "real time clock (RTC)" module which is including a Xtal and TCXO
diff -r db76c68f998f -r e2a6ac61fcbd PCF2127.h --- a/PCF2127.h Wed Dec 10 01:43:30 2014 +0000 +++ b/PCF2127.h Wed Dec 10 02:07:35 2014 +0000 @@ -2,7 +2,7 @@ * PCF2127 library * * @author Akifumi (Tedd) OKANO, NXP Semiconductors - * @version 1.7 + * @version 1.8 * @date 10-Dec-2014 * * PCF2127 is a "real time clock (RTC)" module which is including a Xtal and TCXO @@ -20,6 +20,39 @@ #include "mbed.h" +/** PCF2127 class + * + * This is a driver code for the PPCF2127: "real time clock (RTC)" module which is including a Xtal and TCXO + * This class provides interface for PCF2127 operation and accessing its registers. + * Detail information is available on next URL. + * http://www.nxp.com/products/interface_and_connectivity/real_time_clocks/rtcs_with_temp_compensation/series/PCF2127.html + * + * Example: + * @code + * #include "mbed.h" + * #include "PCF2127.h" + * + * PCF2127 rtc( p28, p27 ); + * + * int main() + * { + * time_t t; + * + * printf( "PCF2127 demo started.\r\n" ); + * + * if ( rtc.is_init_required() ) { + * rtc.set_time( "2014 12 10 12 00 00" ); + * } + * + * while ( 1 ) { + * t = rtc.time( NULL ); + * printf( "%s\r", ctime( &t ) ); + * wait( 0.25 ); + * } + * } + * @endcode + */ + class PCF2127 { public: