Electronic perpetual calendar control circuit board program development
1.The design principle of single-chip microcomputer
Design a perpetual calendar based on single-chip microcomputer control, and obtain time information and temperature information by reading the output of the clock chip and temperature sensor. and display on the LCD screen. The whole system includes a single-chip main control module, a temperature acquisition module, a display module, and a button control module.
2. Design idea of electronic perpetual calendar
(1) Design goal: This topic is to design a perpetual calendar based on single-chip microcomputer control, and obtain time information and temperature information by reading the output of the clock chip and temperature sensor. and display on the LCD screen. The whole system includes a single-chip main control module, a temperature acquisition module, a display module, and a button control module.
(2) The overall framework of the system: This system is composed of AT89S51 single-chip microcomputer minimum system, power supply circuit, LCD display drive circuit, temperature acquisition circuit, key circuit, clock acquisition circuit, etc.
3. Electronic perpetual calendar hardware circuit design
This system is composed of AT89S51 single chip minimum system, power supply circuit, LCD display drive circuit, temperature acquisition circuit, button circuit, clock acquisition circuit and so on. The hardware circuit design is described in detail below.
(1) Power supply circuit design: The power supply circuit is the basis of the hardware circuit work. In this design, the input voltage of the power supply is DC 24V, and the switching power supply supplies power to the system. In the figure, pin 2 of the power supply chip is the input terminal of the power supply, and VIN is connected to the positive output terminal of the switching power supply. D1 is a diode, and its role in the circuit is to prevent reverse connection protection. If the operator reverses the power supply, the system will not supply power to the outside. C18 and C19 are filter capacitors. C12 and C11 form the input filter circuit. In the filter circuit, C19 can filter out the high-frequency components in the DC output, and C18 selects the electrolytic capacitor, and uses the DC blocking and AC characteristics of the electrolytic capacitor to filter out the mixed AC components in the output of the switching power supply. The SW pin is the DC output of the power chip, because the power chip is a switch type, there will be an AC component in the chip output, so the L1 filter inductor and C33C20 are selected in the design to form the output filter circuit. D2 plays the role of freewheeling in the circuit, protecting the chip from being broken down by the induced voltage generated.
(2) Minimum system design of single-chip microcomputer: the main control circuit of the system is composed of MCU, XTAL circuit and reset circuit. As the basic circuit of the whole system, this circuit provides important functions such as clock and reset for MCU work. C2 and C3 are the start-up capacitors, the crystal oscillator is 12MHz, the reset pin is the reset pin, and the reset circuit is composed of C1 and R10. Once the button is pressed, the level of the RST pin is pulled low, which will reset the microcontroller. The minimum system of single-chip microcomputer is the basis of the whole hardware design. When the minimum system of single-chip microcomputer works normally, the designed program can be executed normally. The 40-pin of the single-chip microcomputer is connected to the power supply, and the 20-pin is grounded. Mainly speaking, the single-chip microcomputer can supply power normally on these two pins. After power-on reset, the single-chip microcomputer can run the program in the program storage normally, and realize the input and output control of the system.
(3) Liquid crystal display circuit design: The interface circuit between the single-chip microcomputer and the liquid crystal can realize two ways of serial connection and parallel connection. The serial connection method can save the IO resources of the single chip. Under normal circumstances, such an interface method can be selected, but the serial interface method makes the reading and writing speed of the LCD slower. It may cause a delay in the display. In this design, after calculation, the input and output IO ports are sufficient to meet the requirements of the system, and the parallel interface communication mode is selected. Although parallel transmission takes up more IO resources, the accuracy of the display is guaranteed due to the faster transmission speed. The operation of the LCD requires advanced operations on the chip selection line, read/write line, enable line and data of the LCD. In this design, the MCU P00-P07 is connected to the DB0-DB7 interface of the LCD, and P22P23P24 are respectively connected to the RSRWE of the LCD. The pin 5 of the LCD is the backlight output pin. In the design, it is connected with the sliding rheostat and this pin to realize the control of the LCD backlight output by changing the size of the resistance.
(4) Clock circuit design: DS1302 is a real-time clock chip in 8-pin SOP package, 1 and 8 are power pins, you can choose to power off the battery and main power, and the clock chip will also work normally. Here, two power sources are provided for the clock chip to prevent inaccurate power-off time. Use a 32.768KHz crystal oscillator and match two 22pF start-up capacitors. In the design, the P10 pin is connected to the 7th pin of the clock chip to provide the read and write timing of the chip, and the P12 is connected to the 5th pin of the chip to reset the chip. When operating the chip, the chip should be reset first. After the operation is completed, the single-chip microcomputer sends the read and write sequence through the control of pin 7, and then sets the initial time through pin 6. Set the current time through the write register in 80H to 88H. After the setting is completed, the chip will automatically start timing. When the system time needs to be read, the time can be read from the chip through the read time command.
The above is the development example of the electronic perpetual calendar circuit board introduced by Shenzhen Zuchuang Microelectronics Co., Ltd. for you. If you have electronic perpetual calendar program development needs, you can trust us. We represent a variety of single-chip microcomputers, voice chips, dual-mode Bluetooth ICs, and wifi chips. Brands include Songhan MCU, Yingguang MCU, Jerry Bluetooth, Ankai Bluetooth, Allwinner, and Realtek. Our technical services include: PCB design, MCU development, Bluetooth solution, software and hardware custom development, APP development, small program development, WeChat official account development, etc. It can also undertake the design of intelligent electronic products, the development of living appliances, the research and development of beauty equipment, the application of Internet of things platform, the smart home control system, the development of TWS earphones, Bluetooth earphone speakers, the development of children's educational toys, the design of electronic education products, etc.
Proposal recommendation
- TOP