1、Design of the digital Perpetual Calendar based on real-time clock chip Abstract:This Electronic calendar uses the AT89S52 microcontroller as the core for the control. Time Circuit which is constituted by Dallass DS12C887A real-time clock chip achieved a time and date display, it increased functional
2、ity for the temperature display and the whole point timekeeping. This paper discusses the hardware circuit of the system, principle in detail,and gives the flow chart of the software design and the major source code. keywords:microcontroller; real-time clock; Temperature measurement 1 Introduction E
3、-calendar-bedroom at home,schools,stations and more and more extensive use of plaza for peoples lives,study,work great convenience. Electronics calendar for the past need to re-adjust after power-off time and date,and time is a big error. Designed the system using real-time clock chip (DS12C887A) as
4、 a timer parts,the chip comes with an internal crystal oscillator,so that effectively guarantee the accuracy of the time and hang own internal battery power makes the situation will continue to update the time information . This design uses AT89S52 as the main controller,in order to improve the prac
5、ticality of the circuit add temperature measurement circuit,timekeeping and alarm functions. 2 System hardware design Schematic circuit shown in Figure 2: System architecture diagram 2.1 Power Supply Circuit In order to reduce circuit costs,the system power supply circuit by the transformer transfor
6、mer,three-terminal integrated regulator (L7805 circuit 5V, has a simple,reliable, inexpensive and so on. 2.2 Host Controller Host controller using ATMELs latest MCU Products AT89S52. Apart from the single-chip microcomputer has a MCS-51 series single-chip all the benefits of Real-Time Clock Core 片 A
7、udio signal generator and driver Single-chip controller AT89S52 LED Key circuit Temperature measurement circuit Power circuit things,also has 8KB of internal in-system programmable FLASH memory,free and low-power brown-out mode, greatly reducing the power circuit . In addition,also has a watchdog ci
8、rcuit,a reliable job for the circuit provides greater assurance. 2.3 digital tube display circuit Show circuit with a high brightness,long life,low cost features such as the LED digital tube. Throughout the show circuit by the digital control and display LED drive circuit and decoding circuit. Becau
9、se of the system to display the contents of more,a total of 16 digital tube, respectively,with eight shows year,month,day,four show time,show that 22 weeks,2 show the temperature. Controller in order to save resources,between the controller and displays add a decoding circuit 16 so that would have r
10、equired the line of control into the circuit only 4 control lines,a great save system resources. The decoder by the decoder constitute both 3-8. 2.4 Real-time clock chip This design uses the United States Dallas company DS12C887A, the chip can automatically generate century,year,month,day,hour,minut
11、e,second,such as time information. Century the use of internal registers with the software will be able to resolve the Millennium, the problem. The chip has its own internal battery-keng,external brown-out,the internal time information also be able to maintain for 10 years. Time for a single day rec
12、ord of 12 hours and there is a 24-hour mode. Time Table Ways that also has two kinds of binary numbers,and the other with BCD code express. The chip with 128 bytes of internal RAM,one of 11 bytes used to store time information,4 bytes of memory chips used to control information,known as the control
13、register,113-byte general-purpose RAM for users to store temporary information. In addition,users can also program the chip to control a variety of square-wave output,and its internal three-way through the software interrupt shielding. 2.5 Buttons and temperature measurements and circuit The system
14、in order to make the circuit more easy,button circuit design only three keys, which are set,+,-, three keys to adjust the calendar and clock. The system in order to improve the practicality of the circuit,an increase of a temperature display. The system temperature measurement circuit using Dallass
15、DS1280. The device because of its low price,easy circuits,measurement precision,etc. 2.6 audio signal generator and driver circuit The circuits function is to receive control circuit to send to the entire point of time and timing signal,according to system settings produce different frequencies of a
16、udio signals,amplification by the drive circuit to drive speakers to voice their opinions in order to realize the whole point timekeeping and alarm functions. 3 system software design Procedures of the system by the main program interrupt service function and pose a number of Functions. Main functio
17、n and interrupt the completion of the initialization function. Timer interrupt function main timing clock chip to complete scanning and keypad scanning. Clock chip main function is to read and write time,read out the calendar information and to amend the specific value of the internal write clock chip. The main source code is as follows: