Jump to content
Sign in to follow this  
eelcor

[Tip] Nice realtime clock with the PCF8563

Recommended Posts

Hi everybody,

 

As a part of my long term project building wireless sensor nodes, I have been looking for a nice RTC chip. First I was drawn to the DS1307, but this part is 5V and only a clock without alarm functions. Googling to the internet I've found the PCF8563. This part is a "drop in" replacement for the DS1307, but offers a lower supply voltage (3.3V) and includes alarm functions. The chips can be sourced quite cheap from the internet and work like a charm with both 6pf and 12pf 32768kHz crystals.

 

A nice tutorial how to connect these things can be found using the following link: http://startingelectronics.com/beginners/start-electronics-now/tut16-arduino-clock/

 

It is written for the Arduino but can be adapted easily to the launchpad. Just change the LiquidCrystal pins to free pins on the Arduino and voila there you have a nice RTC that can be used for sprinkler projects or other projects. The alarm can be set on different days of the week (not a specific date), but with some program logic a calendared version should be possible.

 

I am thinking of writing a library out of the tutorial. Anyone interested?

 

Kind regards,

 

Eelco

Share this post


Link to post
Share on other sites

That sounds like a great option! I cannot determine if it is a DIP package or a SO package. Great to chose between SPI and I2C. Any ideas regarding the command set?

 

Kind regards, Eelco

Share this post


Link to post
Share on other sites
The PCF2129A is a SOIC20 package. I've soldered it on a DIP14 support and I'm using it in I2C mode.
 
post-12238-0-45271500-1377675921_thumb.jpg post-12238-0-68225000-1377676394_thumb.png
 
For I2C
  • SCL(1) = I2C clock
  • SDA(4) = I2C data
  • IFS(5) connected to BBS(18) = output voltage to select I2C
  • SDI(2) connected to VSS(8) = ground
  • VDD(20) = +3.3V
  • VBAT(19) = optional battery 
  • VSS(8) = ground

For I2C, don't forget to use pull-ups resistors for SDA and SCL.

 

 

For SPI, not tested
  • SCL(1) = SPI clock
  • SDI(2) = SPI MOSI
  • SDO(3) = SPI MISO
  • CE(4) = SPI chip enable, active low
  • IFS(5) connected to VSS(8) = ground to select SPI
  • VDD(20) = +3.3V
  • VBAT(19) = optional battery 
  • VSS(8) = ground

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×