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.
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.
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.
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.
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.
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.
Previous article:Circuit design of playback system using DTMF voice identity recognition
Next article:Microcontroller Introduction Tutorial Lesson 22 - Serial Port Application Programming Example
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- Brief Analysis of Automotive Ethernet Test Content and Test Methods
- How haptic technology can enhance driving safety
- Getting Started with Modelsim
- Crosstalk Elimination Technology in Altium Designer
- Evaluation Weekly Report 20220207: How many days are left to apply for Qinheng ch582 and Pingtouge Linux RISC-V kit
- ESD resistance of capacitors
- Date in spring + small flowers blooming in the spring bushes
- [Sipeed LicheeRV 86 Panel Review] Debian Python + Serial Communication
- What is the 5G battle about?
- Zero-based development of WIFI devices
- A detailed description of the development history of Bluetooth technology from 1.0 to 5.0
- Fundamentals of mmWave Sensors (mmWave Training Series)