Skip to content

PICAXE clock exercise: hardware

A clock can get rather complex! The idea with this one was to see how the I2C works. I picked up a $5 board on E-Bay with a DS1307 clock, and 24c32 EEPROM, and an optional temperature sensor that all communicates via I2C. You can see it near the bottom of the picture here with a battery (rechargeable lithium coin cell) on the backside. It is mounted on one of the bolts holding the LCD Panel in place.

The LCD panel is a standard parallel communications Hitachi chipset with 2 lines of 20 characters salvaged from an old plotter. The PICAXE AXE401 shield base (phanderson.com source) that includes a prototype shield was the microcontroller environment. The LCD was wired to the prototype shield to be compatible with common Arduino LCD shields. The box is a Radio Shack ABS project box. You can just see the holes in the face opposite the LCD for access to the power and communications port on the AXE401. There is plenty of room for adding things.

There are a couple of resistors to divide the supply voltage and present a third of the source (battery) voltage to an ADC pin. That is the start of a power monitoring function.

Complex? That’s in the software and it is easy to get carried away. The clock chip has static ram backed up by battery that can be used for configuration data. A first set of options is to make it easy to place what clock and calendar data goes where on the screen. Then it’d be nice to put an abbreviation for the month as well as just the number. A calculation to determine day of week allows showing an abbreviation for weekday as well. Automatic daylight savings time adjustment is another convenience. The problem of how to set the clock is not so trivial either.

As for hardware plans: probably first up is to see if those LCD mounting bolts can be used as touch buttons. I will need to cover the heads with lacquer or something. A button of some sort would allow a seconds to zero function to synchronize it with WWV. There is a clock output that toggles once a second. This needs to be run to an interupt pin so that the clock can be checked on it’s schedule rather than in a delay loop.

This could be the start of a station utility. The radio communications link might be tapped to monitor radio frequencies and modes. An SWR bridge could be monitored to determine transmit power and antenna loading. Parameters could be logged in the EEPROM with a timestamp.

Next up will be code examples for the PICAXE clock exercise.

Post a Comment

You must be logged in to post a comment.