

If you wish to make this circuit and you also wish to be accurate enough, then you HAVE to follow the guidelines of this document:Īpplication note 58 - Crystal Considerations with Maxim Real-Time Clocks (RTCs) The reason? Parasitic pulses on the crystal. Every 5 to 10 minutes, your clock will be 1 to 2 seconds faster than the real time. If you do not wish to use a backup battery, then you have to ground the V BAT pin.Īnother problem that will occur when you prototype this circuit on a breadboard, is that it will probably run fast. The battery MUST be included in the circuit, otherwise it will not operate normally. First of all, something regarding the backup battery. There is one rule when you start playing with a new chip: Read the datasheet (RTFM)! STUDY the datasheet i might say.

If the seventh button is pressed simultaneously, then each time a button is pressed the value is decreased.īefore you get a headache - Your clock may run fast or slow! Each time a button is pressed, the value is increased. The first 3, are to set the date (day month year), while the other 3 are to set the time (hour min sec). There are 7 push buttons to set the time and date. Otherwise there will be an unwanted timing offset. The capacitor holds enough current to keep the RTC running for some time, even without the coin cell batter.Īs mentioned before, the crystal must have 12.5 pF load capacitance to match the internal capacitance of the chip. This capacitor will act as a back-up-back-up power if the main power is turned off and the battery is removed. I added a big 1000uF capacitor in parallel with the battery back-up for only one reason. I do not need to use any external library, as the connection is done by hardware. This module will do all the dirty work to communicate with other chips using I 2C protocol. The PIC 16F1937 has a built in I 2C hardware module. This pin (RC4/SDI/SDA/T1G/SEG11) along with pin 18 (SEG6/SCK/SCL/RC3) are used to interface the DS1307 chip.

The LCD occupies pins 21 through 28, except pin 23. The circuit with a 7-buttons keypad attached Click the following schematic to enlarge it: You can store for example alarm notifications.
#Maxim time clock full#
Each time/date set has 7 bytes of data, so you can store 8 full time/date sets (8x7=56). Choosing for example a crystal with load capacitance 6pF causes the RTC to be about 3 to 4 minutes per month faster.Īnother nice feature with this chip is that it provides 56x8 extra RAM space for data saving. Other value than that may result in faster or slower pulses. When choosing one to buy, you must choose one with Load Capacitance 12.5 pF. The chip uses an external 32.768kHz crystal for the oscillator. One thing that has to be taken into account is the crystal. According to the manufacturer, a lithium battery with 48mAh will back up the chip for more than 10 years in the absence of power! The consumption in that case is as low as 500 nA. This provides power to the chip whenever the main power supply is off. The DS1307 has an extra power pin to connect a 3V coin battery. All the hard job is done by hardware, which makes the assembly sheet much more smaller and simpler to follow. The module can be configured to operate with 7 or 10 bit addressable clients. This is a remarkable feature for this microcontroller. I will use the PIC 16F1937, because it has enough pins for my future project and it has a built in I 2C module, the MSSP. The chip uses I 2C protocol to communicate with the microcontroller. This time, i decided to use the DS1307 RTC chip from Maxim. The greater the experience i get, the more the parameters i include in my search criteria, parameters like price, package size, functionality, extra features and more.
#Maxim time clock how to#
The Maxim DS1307 is one very good solutionīeing a PIC circuit designer has one great advantage over using arduino or other development platforms: It gives you the ability to learn how to choose the right chip for your job. This circuit will help you understand how to use the built-in I2C communication module of PIC microcontrollers, and also how to use the Maxim DS1307 Real Time Clock chip. This chip is responsible for keeping the time. No matter what, i will certainly need to interface an RTC (stands for Real Time Clock) chip. Then i thought that i should spice it up a little bit, and make a programmable IR universal timer, or something. He wants me to build something that will communicate with his air condition through an IR receiver that it has, and it will act as a programmable timer, to turn it on and off automatically. The circuit assembled on a breadboard for testĪ friend of mine asked me to design a home automation for him.
