Pond Electronics - Home of the µFlash876 & µFlash876B embedded controllers, µStack & µConnect Bus.

Real time clock for the µConnect bus

Unlike the original µFlash876, the µFlash876B does not include a real time clock. This application note shows how a battery backed up RTC can be added to any system that supports µConnect by building a real time clock module onto a µC-P1 prototyping board.

The µC-P1 board provides all the connectors, signal buffering and power regulation necessary for the application, all we need to add is the circuitry for the I2C based RTC. The RTC chosen for the project was the DS1307, this is the same one used on the original µFlash876. We have included an LED on the RTC clock SQW/OUT pin to allow easy demonstration of the functioning unit.

The circuit shown below was constructed on the prototype area of a µC-P1 prototype board. You can see how only a few connections are required. It took less than 15 minutes to build the circuit onto a µC-P1.

Once complete the circuit can be connected to a µFlash876B with a µConnect cable (RJ45 UTP Patch Cable), after which it can be accessed by the µFlash as if it was on the local I2C bus.

It is worth noting that each µC-P1 board can support multiple local I2C chips, it would have been a relatively easy matter to also include (for example) EEPROM memory on this µC-P1 by also wiring a serial EEPROM (such as the 24LC64) to the SCL and SDA signals.

 
// CCS PIC C code to flash the LED on the RTC board
// Will also work with C2C, may require slight modification
// for other compilers
 
#include "uF876.h"  // include uFlash support code
#include "uConn.h"  // include uConnect support code
 
void main(void)
    {
    while(1)
        {
        uc_wstart(0x68);   // address the rtc (write)
        uc_write(0x07);    // ctrl reg @ 0x07
        uc_write(0x00);    // led on
        uc_stop();         // done
 
        delay_ms(500);     // delay half a second
 
        uc_wstart(0x68);   // address the rtc (write)
        uc_write(0x07);    // ctrl reg @ 0x07
        uc_write(0x80);    // led off
        uc_stop();         // done
 
        delay_ms(500);     // delay half a second
        }
    }
 

 

Copyright (c) Paul O Neill & Pond Electronics 2003.

Home | Products | Technical Info | How to Order | Contact Us | Links