Shenzhen ZTRON Microelectronics Co., Ltd
Telephone
0755-8299 4126

convenient tools

Electronic Perpetual Calendar Solution


With the continuous development of the economy, people's requirements for the quality of life are also constantly improving. In terms of electronic technology, manufacturers have also continuously introduced various electronic products to meet people's needs, and the electronic perpetual calendar complies with people's requirements for time. However, the traditional electronic perpetual calendar has a relatively single function except for displaying the time, and has gradually lost the market. In view of this situation, the electronic perpetual calendar introduced in this article adopts the control technology based on AT89C51 single-chip microcomputer, and combines the voice recording and playback module ISD1420 and infrared remote control technology, so that it has the functions of remote control time adjustment and voice time reporting, which has certain novelty And practicability, use is also more convenient, has a certain market prospect.


1. The overall design scheme of the voice electronic perpetual calendar system


The overall design block diagram of the system is shown in Figure 1. The hardware structure of this system is mainly composed of the main control chip AT89C51 single-chip microcomputer, the infrared receiving circuit composed of the integrated infrared receiving head, the real-time clock chip DS1302, the voice recording and playback chip ISD1420, and the digital tube display driving circuit. The system uses the real-time clock chip DS1302 to generate time information such as year, month, day, hour, minute, second, week, etc., processes the time information through the single-chip microcomputer and sends it to the digital tube display driving circuit; the infrared receiving circuit is used to receive and demodulate the infrared The control signal sent by the remote control is recognized by the single-chip microcomputer and sends out a time adjustment or voice time reporting command; after receiving the playback command, the voice recording and playback chip ISD1420 combines the stored voice data according to the address of the voice information sent by the single-chip microcomputer, and sends out and time The corresponding voice information realizes the voice time reporting function.


图1 电子万年历总体设计框图


2.The selection of key components in the electronic perpetual calendar system


2.1 AT89C51 MCU


AT89C51 is a 51 series single-chip microcomputer produced by ATMEL company. Its internal resources and port definitions are compatible with MCS-51 single-chip microcomputer. In addition, the built-in flashROM of this chip allows programming and writing to be repeated more than 1000 times, which is suitable for use in the development stage.


2.2 Serial clock chip DS1302


DS1302 is a clock chip with real-time clock/calendar and 31 bytes of static RAM introduced by DALLAS company, and communicates with the single-chip microcomputer through the serial interface. The real-time clock/calendar circuit provides time information such as seconds, minutes, hours, days, weeks, months, years, etc. The number of days in each month and the number of days in a leap year can be automatically adjusted, and the clock operation is determined by the AM/PM flag to use 24 or 12 hours Time format. The DS1302 and the microcontroller can communicate in a synchronous serial manner, and only need three wires, the reset line RST, the I/O data line, and the SCLK serial clock line, to complete the data communication. DS1302 data transmission mode has single-byte and multi-byte transmission modes. According to the timing of control command word and data transmission, the single-chip microcomputer can reset the time and read real-time time for DS1302. The power consumption of DS1302 is very low when working, and the power is less than 1mW when maintaining data and clock information. DS1302 is widely used in telephones, faxes, portable instruments, and battery-powered instruments and meters.


2.3 Voice recording chip ISD1420


The ISD1420 chip adopts CMOS technology, the recording and playback time of a single chip is 20 seconds, and the sound quality is good. After the recording and playback operation is over, the chip automatically enters the low-power saving mode, and the power consumption is only 0.5uA. The sampling frequency of the chip is from 5.3, 6.4 to 8.0KHz, the information on the chip can be stored for 100 years (without backup power supply), and the single chip of EEPROM can record 100,000 times repeatedly.


The recording and playback operation of ISD1420 is controlled by /REC, /PLAYE, /PLAYL, /RELED. /REC is the recording control terminal, low level is effective. As long as /REC goes low, the chip starts recording. When /REC becomes high or the memory is full, the recording cycle ends, and the chip automatically writes an end mark (EOM), so that the subsequent playback operation can be stopped in time, and the function of segmented recording is realized. /PLAYE is an edge-triggered playback terminal, when a falling edge occurs, the chip starts to play. The playback continues until the EOM mark or the end of the memory, after which the chip automatically enters the power-saving state. After the recording or playback ends, the chip automatically enters the power-saving state. Recording indicator (/RECLED) In the recording state, this terminal is low and can drive the LED. In addition, when the playback encounters the EOM mark, this terminal outputs a low-level pulse.


2.4 Integrated infrared receiver


The receiving part of the infrared remote control system adopts the integrated infrared receiving head LT0038 to receive the control signal sent by the TV remote control. LT0038 is a plastic integrated infrared receiver. It is an integrated circuit integrating infrared reception, amplification and shaping. It does not need any external components to complete all the work from infrared reception to output compatible with TTL level signals. It is low level when there is an infrared signal, and it is high level when there is no infrared signal. It is suitable for various infrared remote control systems and infrared data transmission. There are many special chips for remote control transmitters, which can be divided into two categories: pulse width modulation and pulse phase modulation according to the encoding format. In this system, the remote control of the TV is directly used as the transmitting part, and the codes of its keys are directly used.

电子万年历方案开发


3. Electronic perpetual calendar hardware design


(1) Display part: In order to reduce the occupation of the single-chip microcomputer port and meet the requirements for the driving current of the digital tube, this system uses a serial-to-parallel conversion chip 74LS164 as the driving chip, and outputs to the serial port of the single-chip microcomputer when the single-chip microcomputer is in working mode 0. The data is serial-to-parallel converted, and used as the segment code of the digital tube to drive the digital tube to display the data. Since the perpetual calendar uses more than a dozen digital tubes, two 74LS164s are used here to expand and drive the upper and lower sets of digital tubes respectively. The digital tube display adopts dynamic scanning technology, and uses the P0 port to light up the digital tubes one by one.


(2) Clock interface part: SCLK, RST, and I/O ports of the serial clock chip are connected to P1.0, P1.1, and P1.2 of the single-chip microcomputer respectively. According to the timing chart of DS1302 data transmission, the serial data transmission is completed by software simulation. VCC2 of DS1302 is connected to a 3.6V lithium battery as a backup power supply after the main power supply fails.


(3) Infrared remote control receiving interface: the output terminal of the integrated infrared receiving head is connected to the external interrupt 0 port of the single-chip microcomputer. When the remote control sends out a control command, the integrated infrared receiving head demodulates the received signal, decodes it and sends Issue an interrupt request to make the microcontroller respond to the command request from the remote control.


(4) Voice recording and playback interface: the P2 port of the microcontroller is connected to A0-A7 of the ISD1420 as an address selection line. The /PLAYL, /REC, and /RELED of the ISD1420 are respectively connected to the P1.5, P1.6, and P1.7 ports of the microcontroller. When recording, the MCU sends the address of the ISD1420 recording and playback voice through the P2 port, and sets the /REC port to low level through the P1.6 port, and the ISD1420 starts recording from the specified address. Internally, the end-of-segment flag EOM is automatically added. When playing, the single-chip microcomputer outputs the address of the specified playback segment from the P2 port, and sets /PLAYL to low level through the P1.5 port, and the ISD1420 starts to play the sound from the specified address. Stop, the single-chip microcomputer utilizes the EOM sign output from RECLED to start and send out the playback address of the next section, so that continuous playback can realize the function of voice time reporting.


4. Electronic perpetual calendar system software design


The software design of this system adopts the C language programming of the one-chip computer to realize. It mainly includes the interface program between DS1302 and MCU, the interrupt processing program of MCU responding to infrared remote control signal, the voice recording and playback program of MCU controlling IS1420, and the display driver program of MCU serial output to 74LS164. The interface program between the serial clock chip DS1302 and the single-chip microcomputer and the serial port of the single-chip microcomputer are in the working mode 0. The serial-to-parallel conversion program through 74LS164 has been introduced in various books, so this article will not give repeated introductions. This article mainly introduces the processing principle of the single-chip microcomputer responding to the infrared remote control signal and decoding, and the programming of the single-chip microcomputer control ISD1420 for voice recording and playback.


4.1 Composition of external remote control signal coding solution MCU decoding design


Usually, the signal of the infrared remote control is modulated on the carrier wave of 38KHZ. There are many types of encoding used by the signal, the more common ones are PWM code (pulse width modulation code) and PPM code (pulse position modulation code). The remote control used in this system is in the form of PPM code, which is now introduced. The remote coded pulse signal is usually composed of pilot code, system code, system inverse code, function code and function inverse code.


The boot code is composed of a high level with a width of 9ms and a low level with a width of 4.5ms. The system code is also called the identification code, which is mainly used to distinguish different control systems and prevent misoperation. Function codes are also called instruction codes, which represent corresponding control functions. The addition of system inverse code and function inverse code is to correct the errors generated in the transmission process and improve the anti-interference performance. The 8-bit data code of each button in the remote control of the TV is firstly detected by using the single-chip circuit, and then the function of each button is formulated according to the data code. The function of each number key in the remote controller is reserved here, and the addition and subtraction keys of the channel are used as the addition and subtraction setting function of the timing time, and the on/off key is used as the voice time reporting control key. In this way, the function key pressed by the operator is judged in the external interrupt processing program of the single-chip microcomputer, and then the corresponding processing program is executed.


4.2 Voice time reporting program controlled by MCU


In the voice recording and playback chip ISD1420, the voice morpheme that requires real-time time reporting is recorded in advance by segment. After analyzing all the sentences, the following 17 fields and morphemes are required: beep (00), zero (01), one (02), two (03 ), three (04), four (05), five (06), six (07), seven (08), eight (09), nine (0A), ten (0B), minute (0C), second (0D ), point (0E), Beijing (0F), time (10). When recording, the address interval between two adjacent speech segments is 8, that is, the recording time of each speech segment is controlled within 1 second, and the 17 fields and morphemes used are distributed within the 17-second recording interval without exceeding ISD1420 has a maximum recording time of twenty seconds. The following is an example to illustrate the realization of the voice timekeeping function through the single-chip microcomputer program. Assuming that the current time is 16:47, we need the time signal from the voice circuit to be "beep, 16:47 Beijing time". The single-chip microcomputer in the circuit splits the internal time and sub-unit data, and generates the following code internally according to the segment number and command format of the voice segment in the voice chip: 00 0F 10 0B 07 0E 05 0B 08 0C. The above data are expressed in hexadecimal, "00" means the prompt tone "beep", "0F" means "Beijing", "10" means "time", "0B" "07" "0E" "05" "0B "" "08" and "0C" respectively represent "ten", "six", "point", "four", "ten", "seven" and "point". In this way, as long as the above-mentioned sections of speech are played out in sequence, the synthesis and playback of the sentence is completed.


conclusion


The electronic perpetual calendar implemented in this design uses a single-chip microcomputer as the main control chip, an external voice recording and playback chip ISD1420, an integrated infrared receiver and a clock chip DS1302, so that the perpetual calendar not only has the characteristics of accurate timing and easy expansion of functions, but also has remote control debugging. , The function of voice timekeeping makes this product have the characteristics of convenience, fun and vividness, and is suitable for family timing and timekeeping applications. Through software debugging and hardware testing, all parts of the system have achieved the expected functions. In addition, on the basis of the voice circuit design, it can also be applied to various systems such as industrial measurement control, water conservancy monitoring, public security alarm system, smart phone system, meter, bank reporting system, road toll system, etc.


The above are the details of the electronic perpetual calendar solution introduced by Shenzhen Zuchuang Microelectronics Co., Ltd. for you. If you have the development and design needs of electronic perpetual calendar, you can trust us. We have rich experience in custom development of electronic products. We can evaluate the development cycle and IC price as soon as possible, and can also calculate the PCBA quotation. We are a number of chip agents at home and abroad: Songhan, Yingguang, Jieli, Ankai, Quanzhi, realtek, with MCU, voice IC, Bluetooth IC and module, wifi module. Our development capabilities cover PCB design, single-chip microcomputer development, Bluetooth technology development, software customization development, APP customization development, WeChat official account development and other hardware and software design. It can also undertake the research and development of smart electronic products, the design of household appliances, the development of beauty equipment, the development of Internet of Things applications, the design of smart home solutions, the development of TWS earphones, the development of Bluetooth earphone speakers, the development of children's toys, and the development of electronic education products.

  • TOP