Shop OBEX P1 Docs P2 Docs Learn Events
Clock with BS1 and DS1302 — Parallax Forums

Clock with BS1 and DS1302

mw0868mw0868 Posts: 4
edited 2009-08-11 18:06 in Robotics
Hello,

I thought I'd submit yet another clock project. Here is a YouTube clip with stills and video:

www.youtube.com/watch?v=U3HXW0oYbps

The clock shakes a smiley jingling cat toy at the designated alarm time and on the hour if desired.

I've attached a schematic (JPG) and code. The code uses all but 2 bytes in the BS1. Since code space was limited, I must enter decimal equivalents of binary-coded-decimal values to program the clock via a serial terminal app (like Windows Hyperterminal). It uses 24-hour mode in a DS1302 chip. The clock will display its current settings to the terminal slightly faster than once per second. A switch on the clock puts it into programming mode. Then I can enter a time and alarm time. For example, typing 35 89 0 1 will set the time to 11:59pm (23:59) and set the alarm for 12:01am (00:01 or one minute after midnight). Adding 128 to the alarm hours field disables the hourly chime function. A time setting of 255 0 will be ignored which provides a way of updating the alarm without changing the current time.

Enjoy!

roll.gif
758 x 610 - 55K

Comments

  • mw0868mw0868 Posts: 4
    edited 2009-08-11 18:06
    Oops.· I have received a bug report regarding the hourly chime logic.· Occasionally the clock chimes on the hour and then chimes again one minute later.· I read hours, then minutes, then seconds.· The clock chimes when minutes = 0 and seconds = 0, but sometimes there's a seconds rollover in between reading minutes and seconds.· That can cause a bogus chime.· For now, I'll just call it a feature.
Sign In or Register to comment.