Since the advent of single-chip microcomputers, they have been widely used in the fields of instruments, meters, and intelligent control. Most single-chip microcomputer application systems (SCAS) cannot do without key input control. The commonly used single-chip microcomputer system keys can be installed on the panel, but for single-chip microcomputer application systems working in the control field and high and low temperature and dusty environments, the life of the keys will be shortened and the failure rate will increase. In order to improve the reliability and durability of the key input of the single-chip microcomputer application system, a single-chip microcomputer remote control key input circuit is designed. The key code is input into the SCAS system through audio sensing; and one machine can be used for multiple purposes, that is, one keyboard remote control can perform key input operations on any number of identical SCAS systems.
Audio sensing principle and circuit structure
The circuit structure is divided into two parts: the remote control and the decoding receiving circuit. Its structure is shown in the figure.
The remote control part encodes the 16 keys, and a unique dual audio signal is generated for each key. This dual audio signal is sent out by the speaker in the form of sound. In the decoding receiving circuit, the microphone receives the dual audio sound signal sent by the remote control and sends it to the decoder circuit. After the decoder circuit correctly decodes it, it outputs a binary code, which is the key code entered by the remote control. In addition, the decoder also outputs a correctly decoded flag signal at the same time, which sends an interrupt request to the MCU, and the MCU can read the key code and execute the corresponding program module according to the code.
2. Circuit Design Principle
1. Hardware circuit design
The remote control key input circuit is shown in the figure.
The core of the circuit is the dual-tone multi-frequency (DTMF) codec chip CSC5087 and SC8870. As a DTMF signal encoder, CSC5087 can generate a set of dual-audio signals cos 27πft+cos 2πfcHt according to different keys. The International Telegraph and Telephone Consultative Committee (CCITT) and China's standards stipulate that the combination relationship between keys and high and low frequency groups is listed in Table 3-1. If key 6 is pressed, the frequency of the DTMF signal sent is fL=770 Hz, fH=1 477 Hz. This DTMF signal is amplified by the audio power amplifier LM386 and converted into a sound signal by the speaker.
Table 1 Key and DTMF signal encoding comparison table
The DTMF signal received and amplified by the microphone is decoded by SC8870, and each DTMF signal is translated into a 4-bit binary code for output. The 16 DTMF signals correspond to 16 binary codes from 0000 to 1111, and their corresponding relationship is listed in the table. For example, if the remote control sends a DTMF signal with a frequency of fL=770 Hz and fH=1477 Hz, the SC8870 will output the code 0110 after decoding.
2SC8870 decoding table
SC8870 has a delay control output terminal CID. If a valid DTMF signal is detected and the control input terminal STO level exceeds the threshold level VTst, the input code is updated, and the CID output changes from low level to high level; if the STO level is lower than V Tst, CID returns to low level. The STO level is determined by the initial control output signal ECO: when SC8870 detects a valid DTMF signal, ECO first changes to high level, and then the STO level is increased through the resistor; when there is no input DTMF signal or the input signal is continuously distorted, ECO outputs low level, so STO is also low level, and CID outputs low level. The CID signal is used as the interrupt request signal of the MC68HC705 MCU. Since the interrupt trigger of the MCU is a falling edge trigger, the CID signal is inverted by the inverter and connected to the interrupt request input terminal IQR of the MCU.
SC8870's DOi~D04 are connected to MCU's port lines PAo~PA3 respectively, and the three-state data output control terminal EN is connected to a high level, so that D01~D04 maintains the last decoded output code of the DTMF signal, so that the MCU can read the input key value at any time.
2. Key input interrupt and key code receiving software
The software flow and program list are shown in the figure.
The MCU receives the key code from the interrupt response program and returns to the main program. The main program decides which functional module to execute based on the key code.
3. Application
Since DTMF signals have high encoding and decoding reliability and low transmission error rate, the key input circuit introduced in this article has strong anti-interference ability and has been successfully applied to the urban street lamp microcomputer monitoring system. The key codes of all switch cabinet measurement and control subsystems are input in this way. They share a remote control, which greatly improves the system's anti-interference, anti-dust, and anti-aging performance.
Previous article:Hardware Design of Single Chip Microcomputer Ultrasonic Vision Recognition System
Next article:Temperature-measurable electronic calendar based on STC89C52 single-chip microcomputer
Recommended ReadingLatest update time:2024-11-16 14:33
- Popular Resources
- Popular amplifiers
- Wireless Sensor Network Technology and Applications (Edited by Mou Si, Yin Hong, and Su Xing)
- Modern Electronic Technology Training Course (Edited by Yao Youfeng)
- Modern arc welding power supply and its control
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications