Electronic calendar clock design based on VRS51L3074 and DS12887

Publisher:快乐舞蹈Latest update time:2024-01-26 Source: elecfansKeywords:VRS51L3074 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  This article is a multi-fixed-point electronic calendar clock based on the typical device VRS51L3074 of the Versa 8051 series MCU and the clock calendar chip DS12887. The system is fully functional and can store multiple trouble spots. It uses liquid crystal display device LCD to display time, calendar and other information with clear and perfect visual effects. It has the characteristics of simple operation, stable operation, low power consumption and easy use.


  1 Plan discussion

  VRS51L307 is the latest 8051 microcontroller with 8 kBFRAM ferroelectric memory launched by American Ramtron Company. This microcontroller integrates peripheral function modules and 40 MI/s (megainstructions/second) single-cycle 8051 core, operates at a voltage of 3.0 to 3.6 V, and has a precise internal oscillator.


  This system uses the VRS51L3074 microcontroller as the control core, and uses the single-chip integrated real-time clock chip DSl2887 to realize the clock function. The display system uses a liquid crystal module LCD to display time, calendar, alarm and other prompt information, and has an intelligent human-machine interface. The circuit diagram designed with this solution is simple and does not require a driver circuit. The time, calendar and alarm clock can be displayed using the parallel port data line. VRS51L3074 has mature flash memory technology and has its own watchdog timer circuit, so that the system can automatically reset when the microcontroller crashes or encounters a program failure. The watchdog timer consists of a 14-bit prescaler to control the system. The clock or the divided signal of the system clock is used as its counting source. When the watchdog overflows, the system will be reset. The system clock frequency can be dynamically adjusted, and it has integrated power saving, power-on reset/power-off detection and other functions.


  2 Basic principles of the system

  Use the VRS51L3074 control function to input the year, month, day, week, hour, minute, second and other information of the real-time clock DSl2887 into the LCD display in parallel. Adjust the time, calendar and alarm clock through the keyboard control function. It is reflected into the microcontroller, and various time, calendar and alarm clock information are input to the LCD display through the parallel port of the microcontroller, thereby realizing the control function of the entire design.


  This system accesses peripheral devices through I/O. The P1 port of the microcontroller is connected to the keyboard. The 8 ports of the P0 port are used as data lines of the microcontroller to connect to the display and real-time clock respectively. P60 and P27 are used as The control end is used to control the data transmission between the microcontroller and the LCD display, as well as the microcontroller and the real-time clock; in this system, since the LCD display is used as the display system, the keyboard is used as the control system, which is beneficial to the portable calendar clock. Operation and control. In this design, the control of each function key is realized through software programming, so that the alarm clock, clock and calendar can be adjusted and controlled by using different function keys on the keyboard. The system diagram of the entire design is shown in Figure 1.

  


  3 System hardware design

  The hardware system consists of a microcontroller and its keyboard circuit, clock system, alarm function and LCD display part. The circuit design of the entire system is based on the design of the microcontroller VRS51L3074 and the clock chip DSl2887, plus the LCD display OCM160128-I (built-in T6963C controller), buzzer and keyboard.


  The VRS51L3074 microcontroller is used as the control core to control the clock chip DSl2887, read the time, extract data, process the input signal, and finally display various time, calendar and alarm clock information through the LCD, thereby realizing the control function of the entire design. The main control circuit of the system is shown in Figure 2. The VRS51L3074 has a built-in 40 MHz oscillator, which can provide clock signals for the system without the need for an external crystal oscillator. The system clock can be flexibly set to meet the needs of different applications by configuring the prescaler between the clock main circuits. System clock source selection and frequency division ratio setting are controlled by special function registers DEVCLKCFGl and DEVCLKCFG2.

  

System main control circuit


  3.1 Interface design interface between microcontroller and DSL2887 clock chip

  The interface between the microcontroller and the DSl2887 clock chip is shown in Figure 3. To achieve synchronous communication between the two, 6 port lines are needed: (1) Reset/RESET. (2)I/O data line. (3) Chip select signal line/CS. (4) Data excitation or read line DS. (5) Read/write, input line R/W. (6) Address activation input line AS.

  

Interface


  Among the above 6 port lines, DS and R/W have two operating modes. This design uses Intel bus timing, so the MOT pin is connected to ground. In this mode, the DS (data trigger or read) pin is called the /RD pin. AD0~AD7 are multiplexed bidirectional address/data buses. The address is presented in the first period of the bus cycle, and the same IC pins and signal paths are used as data in the second period. Since the change of the bus from address to data occurs during the access time of the internal SRAM, the multiplexing of address/data will not slow down the access time of the DSl2887. When the chip select signal line /CS select input is LOW, the DSl2887 can be accessed. Even if the /CS pin is not enabled during the bus cycle, the address will be latched but no access action will occur. When Vcc < 4.25 V, DSl2887 will disable the /CS pin and prohibit access operations. This function will protect the real-time clock and the data in the SRAM during power outage. The address stimulus input AS sends a positive address stimulus pulse to the input pin, and then the falling edge of AS/ALE causes the address to be tethered to the DSl2887. On the next falling edge of the clock, the address trigger input will clear regardless of whether chip select /CS is set. Access commands must be sent in pairs. The /RESET pin signal has no effect on the clock, calendar or SRAM. When the power supply is rising, the RESET pin should be held LOW for a period of time to allow the supply voltage to stabilize. The time the RESET pin is held LOW depends on the application.

  3.2 Interface circuit between microcontroller and LCD display

  In this circuit, the LCD data ports D0~D7 are connected in parallel with the P00~P07 of the microcontroller. As shown in Figure 4. The /RD and /WR read and write strobe terminals are connected to /RD and /WR of the microcontroller. The low level is active and is the input signal. /CE is the chip select signal of T6963C, active at low level. C/D channel selection signal, 1 is the command channel, O is the data channel.

  

Interface circuit between microcontroller and LCD display


  3.3 Noisy alarm function design

  The buzzer alarm circuit is shown in Figure 5. When the clock reaches the specified alarm point, AF in the DSl2887 control/status register 2 is set to 1, and the ALE pin generates an interrupt (active low level). Since ALE is connected to the ALE pin of the microcontroller, an interrupt program is triggered. The SQW of DSl2887 outputs a 1Hz pulse. Since the data information is connected to the P00~P07 pins of the microcontroller, the P20 pin outputs a 1Hz pulse, causing the buzzer to sound intermittently. When the reset pin is low and Vcc>4.25 V, the alarm interrupt enable ALE is set to O, the alarm interrupt flag AF is set to 0, the signal is transmitted to pin 37 of VRS51L3074 through the AS bit, and the pulse is output to the buzzer through the P20 pin, stopping Noisy. The bell will ring for 1 minute when the predetermined time is reached and stop automatically after 1 minute. You can also press the set key to stop manually.

  

Noisy alarm function design


  3.4 Connection between microcontroller and keyboard

  The system uses a columnar keyboard. Use I/O lines to form a row and column structure, and the buttons are set at the intersections of the rows and columns. Therefore, when the number of buttons is large, I/O port lines can be saved. The column lines of the keyboard are connected to P1.0~P1.2 of the single-chip computer respectively, and the row lines are connected to P1.3~P1.5 of the single-chip computer respectively.

  4 Design of software system

  The system software design includes the programming of two parts of the microcontroller computer. Computer software programming mainly implements parameter setting, serial port data reception, instruction sending, and data display and storage. The software programming of the microcontroller mainly realizes the functions of the keyboard, LCD display, alarm clock and other modules, and is programmed in C language. The system communicates with the keyboard through the serial port, and the keyboard sends instructions to the microcontroller to implement data collection and system control, and transmits the data back to the LCD monitor in real time to display the results. The entire software system adopts a modular programming method and is divided into time and date setting, alarm clock

  There are 4 parts: setting, LCD display module and keyboard scanning module. The main one is the setting and extraction of trouble spots. The main feature of the software system is that the entire process is completely under the control of the keyboard, realizing friendly human-computer interaction functions. The main program calls different subprograms by judging the input conditions of the keyboard, and the function realization of the subprograms is also completed with the cooperation of the keyboard. The main program flow chart is shown in Figure 6.

  

Main program flow chart


  First, initialize the serial port and timer of the microcontroller, and then scan the keyboard. If a key is pressed, jump to the corresponding entry according to the scanned key value and execute the corresponding program, and respond accordingly according to the external input. operation. If no key is pressed, return to initialization state. In the parallel running program, this design will call the calendar clock and temperature programs written by two other collaborators and send them to the LCD for display.

[1] [2]
Keywords:VRS51L3074 Reference address:Electronic calendar clock design based on VRS51L3074 and DS12887

Previous article:Circuit design of playback system using DTMF voice identity recognition
Next article:Microcontroller Introduction Tutorial Lesson 22 - Serial Port Application Programming Example

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号