Tag Archives: ds1307

DS1307 Based RTC Module

An RTC Module or a Real Time Clock Module helps a system keep track of current time (hour, minutes and seconds). It automatically increments the time without any help from the host (microcontroller). Other benefit is that it has a backup power supply from a small coin cell that help it maintain the time in absence of power. It needs very small power in backup mode so that the coin cell last for years! One such RTC IC is DS1307. It communicates with the host using I2C serial interface. We have put all the required components in one PCB to make a neat module that we can hook up to our MCUs like PIC or AVR. After the experiment you can put the module safely in your drawer, bring it out after an year and still it will give you the correct time! DS1307 Module Schematic DS1307 Based RTC Module Schematic DS1307 Module Fabricated ! DS1307 Based RTC Module   Professional DS1307 RTC module     Connection with MCU The SCL line of RTC Module will be connected to SCL line of MCU similarly the SDA line will be connected to the MCU’s SDA line. The RTC Module should be powered from the microcontroller development board. Most of our boards have extra 5v output points. Please see their documentation for […]

DS1307 I2C RTCC Interface using SoftI2C lib

In the last tutorial, I explained you how to use our SoftI2C library to read and write a 24CXX series I2C EEPROM. Now I will continue our exploration and write a register access layer for the DS1307 chip. The DS1307 chip is a real time clock and calendar IC. The register access layer that we will develop provides the application programmer with function that reads and write the registers of DS1307. Remember that any piece of hardware appears to the CPU as a set of registers only. DS1307 has :- Seven Registers (from 0x00 to 0x06) that are used for timekeeping functions. One CONTROL register(0x07) for square wave generation setting (we don’t use this for simplicity). 56 bytes of battery backup RAM (from 0x08 to 0x3F) Fig. : A Simple DS1307 RTC Module.   Once the application programmer has access to functions that reads and writes to any register (specified by its address) inside DS1307 ic, he/she can easily get and set the time infos like sec,min,hour, am/pm, date,month,year etc. The register access layer is built over the core Soft I2C layer. The register access layer consists of the following three functions. void DS1307Init(void) { SoftI2CInit(); } /*************************************************** Function To Read Internal Registers of DS1307 ——————————————— address : Address of the register data: value of register is copied to this. […]