Specific implementation functions
The system consists of STC89C52 microcontroller + DS1302 clock chip + DS18B20 temperature sensor
1. Can display year, month, day, hour, minute, second, week, temperature, lunar calendar;
2. The buttons can be used to set the alarm clock and alarm;
3. Press the button to adjust the time and display whether it is a common year or a leap year.
There are 4 buttons in total: Set, Add, Subtract, Switch.
design background
In real life, everyone may have their own clock. Time is passing by without stopping. With a clock, people can live every day in a planned way. However, most clocks now need to replace batteries constantly, and some clocks need external power supply. If the battery is out of power or the external power supply cannot supply power, the clock will stop timing. The new clock calendar chip DS1302 from DALLAS of the United States can solve this problem. The device can provide real-time clock (RTC)/calendar and timer alarm. For months with less than 31 days, the date at the end of the month can be automatically adjusted, including leap year compensation. The device can also work in the 12-hour format of 24-hour forwarder/PM indication. A precise temperature compensation circuit is used to monitor the status of Vcc.
The clock also has the functions that non-real-time clocks do not have, such as environmental protection, no noise, low power consumption, etc. The real-time clock can be used not only at home, but also in public places, such as stations, docks, shopping malls, etc.
hardware design
There are many ways to make a single-chip electronic calendar, and there are also many devices and technologies to choose from. Therefore, the overall design of the system should fully consider the environment in which the system is used, while meeting the system's functions. The selected structure should be simple to use and easy to implement, and the selection of devices should focus on appropriate parameters, stable performance, low power consumption and low cost.
According to the requirements of system design, it is preliminarily determined that the system consists of six modules: power module, clock module, display module, keyboard interface module, temperature measurement module and alarm module. The circuit system block diagram is shown in the figure.
software design
The main program starts initialization and opens interrupts, then scans the alarm clock, keyboard, and reads the 18B20 value. When the S1 key is pressed, the clock setting is executed, and when the S4 key is pressed, the alarm setting is entered. No matter the clock or the alarm clock, it will exit after setting, and the temperature and clock will resume real-time display.
Schematic
The schematic diagram of this system was designed using Altium Designer19, as shown in the figure.
program
This design uses KEIL5 software to implement program design, as shown in the figure.
Simulation Implementation
This design uses protues8.7 software to implement simulation design, as shown in the figure.
Previous article:15-Design of digital frequency meter based on 51 single chip microcomputer
Next article:13-Alcohol concentration detection alarm system based on 51 single chip microcomputer
- Popular Resources
- Popular amplifiers
- 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
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- Shanghai Semiconductor IC Company Epidemic Welfare Package PK, Too Lucky!
- Configuration Case Sharing--Modbus to Profinet Gateway Connecting ACS510 Inverter
- Modification of 4-20mA two-wire passive digital display meter Part 6 (general schematic diagram)
- Radio Frequency Learning Knowledge Consulting Network and Information Query Network (Collation)
- Pixel Pump, an open source vacuum pump using micropython
- Questions about PCF8583
- Answers to questions about programming the Lingdongwei MM32 MCU
- 16-bit MSP430G series microprocessor usage expansion
- [Reprint] STM32 drives VGA display to display IKS01A2 sensor data
- 555 timer frequency drift problem