Small industrial control exchange based on SM8951 and CM8870 dual-tone multi-frequency decoding chip

introduction

The dual-tone multi-frequency (DTMF) signal was invented by Bell Labs. It was originally used as a type of user signaling between a telephone and a switch in a telephone system, and is usually used to send a called number. The DTMF signal is composed of a high-frequency group and a low-frequency group, and the high-frequency group and the low-frequency group each include four frequencies. A high frequency signal and a low frequency signal are superimposed to form a combined signal, which represents a number. There are 16 codes for DTMF signaling. The dual-tone multi-frequency dial keypad is a matrix of 4 & TImes; 4. Each press of a key sends a combination of high-frequency and low-frequency sinusoidal signals, because there is no harmonic interference between any two frequencies, so its anti-interference ability is very strong, and the misjudgment rate after remote transmission is very low.

The DTMF and decoding chip in the switch adopts CM8870 to realize the decoding function of the dual-tone multi-frequency signal on the communication line. The chip converts the detected dual-tone multi-frequency signal into a binary four-bit code and sends it to the microcontroller to provide data flow Purpose information. The dual-tone multi-frequency signal is a group of combined signals composed of high-frequency signals and low-frequency signals. The dual-tone multi-frequency signal decoding is a very important part of the switch. Whether it can accurately decode the dual-tone multi-frequency signal sent by the line is the key to establishing a communication link. Its working situation directly determines the reliability of remote data communication. Sex. The dual audio decoding chip CM8870 used in this system integrates a band separation filter and a digital decoder, which can convert the received DTMF signal into 8421 codes.

1CM8870 decoding function implementation

1.1 Introduction to CM8870 chip

CAMD's CM8870 dual-tone multi-frequency signal decoder is a monolithic 18-pin DIP package chip, which contains filters and data decoding functions, which can filter out non-audio signals except 340 ~ 3400Hz, and convert audio signals into binary 4-bit digital signal, internal CMOS process greatly reduces the chip power consumption, power consumption is only 35mW. CM8870 built-in a differential input amplifier, a clock generator and a three-state latch interface bus, reducing the chip peripheral components, only need to connect a common crystal to work properly. Its characteristics are as follows: provide DTMF signal separation filtering and decoding function; power consumption is less than 35mW; can work in the industrial temperature range; can be connected to a crystal oscillator, and contains a oscillator to generate a reference frequency signal; using 18-pin DIP, EIAJ, OIC, PLCC package.

The basic feature of the CM8870 circuit is to provide DTMF signal separation filtering and decoding functions, and output 4-bit parallel binary codes corresponding to 16 DTMF frequency combinations. The binary codes D1 ~ D4 output by the circuit are controlled by the data output permission section TOE. When TOE is high level, D1 ~ D4 output the binary code corresponding to the currently input DTMF signal; when TOE is low level, D1 ~ D4 terminal High-impedance state. The op amp and R1, R2, C1 form an inverting amplifier, which isolates and amplifies the input DTMF signal, and its gain. K = -R2 / R1, changing the value of R2 can change the size of the gain, VREF is the reference voltage output, Take VDD / 2 = 2.5V; INH and PD are internal circuit connection points, which should be grounded; OSCl and OSC2 are oscillator input and output terminals, external 3.58MHz crystal oscillator and internal oscillator generate reference frequency signal; STD is delay control output terminal, When a valid set of dual-tone signals is received, it outputs "1", otherwise it outputs "O"; ESt is the initial control output terminal. If the circuit detects a recognizable single tone pair, this terminal becomes a high level. If there is no input signal or continuous distortion, ESt returns to low level; SI / GT is the control input / time monitoring output. The functional block diagram is shown in Figure 1.

CM8870 chip internal diagram

A dual-tone multi-frequency signal is a combination of two signals with different frequencies to represent a character or number. These two frequencies are selected from the low frequency band and one from the high frequency band. Each frequency band contains four different frequencies, so a total of 16 options can be combined, and there are only 12 commonly used ones, which are O-9, and # Sign and * sign. CM8870 can decode DTMF signal into 4-bit binary code.

1.2CM8870 number collection process

CM8870 composes the number collecting circuit. Its input is a dual-tone multi-frequency signal from the analog user interface, and the output is 4-bit binary data for the processor to read in from the data bus port. The number collection process is as follows: after the analog signal is introduced from the IN pin, the out-of-band interference signal is preliminarily filtered by the two-tone filter, and then the filtered signal is filtered out by the high group filter and the low group filter. High-frequency and low-frequency components, which are sent to the digital detection and calculation circuit after zero-crossing detection; this circuit further optimizes the audio signal, which can exclude external noise from being encoded by the encoder because it occasionally contains certain specific frequencies. Or it may affect the encoding of the encoder, which may cause subsequent error in number collection. When the high and low frequency group signals are detected by the encoder at the same time, the ESt pin will output a high level as a sign for effectively detecting the DTMF signal, and when the DTMF signal disappears, the ESt pin will output a low level. In order to prevent external noise from being erroneously encoded by the CM8870, the encoder requires the encoded audio signal to be maintained for a period of time, which is determined by an external RC circuit. As mentioned earlier, when the audio signal is detected, ESt outputs a high level 1, the capacitor discharges, the voltage value on VC rises (assuming that the signal exists within the entire required time), and VC rises to a threshold value Vrst, The audio signal is encoded and becomes a digital signal. The digital signal will be latched. At this time, GT is high, so that the voltage at VC rises from the threshold to VDD. After that, as long as ESt remains high , GT is high, the external RC circuit returns to the initial state, and then, after a delay caused by the latch operation, the STD pin outputs a high level, indicating that the signal is latched. At this time, if you want to read these 4-bit codes from Q1 to Q4, you should make TOE high and open the latch to complete the DTMF number collection task.

2 SCM control CM8870 design

2.1SM895l control block diagram

The peripheral circuit connection of SM8951 is shown in Figure 2. The MCU is connected to the analog off-hook circuit through the P1.4 pin. When a device calls for communication, the MCU will detect the off-hook action on the line through this pin, and then the MCU controls the ring current The generator sends a dial tone to the calling party. After receiving the number, the number is decoded with DTMF and decoder and sent to the MCU via the P2.7 pin. The MCU analyzes the number to determine the object of the calling party, and then the MCU Go off-hook and determine whether the terminal switch is idle. If it is idle, send the calling number. After receiving the response, send a ringing tone to the called party and a ringback tone to the calling party. Once the called party goes off-hook, the microcontroller will exit the operation immediately. To complete the call transfer.

SM8951 peripheral circuit connection

The interface circuit of CM8870 and SM8951 microcontroller is shown in Figure 3. The PO.O ~ PO.3 of SM8951 microcontroller read the decoded data of CM8870. When the CM8870 receives a valid DTMF signal, the ESt terminal first becomes a high level, and the SI level of the control input terminal is increased through the integration circuit. If the SI terminal level is higher than the threshold level, the 4-bit binary code in the CM8870 is updated, the STD terminal becomes high level, and the SM8951 MCU detects this information through P2.7 port and starts to receive it. If the CM8870 has no DTMF signal input or the DTMF signal is continuously distorted, the ESt terminal is low, the SI terminal is low, and the STD terminal outputs low.

Interface circuit between CM8870 and SM8951 single chip

The dual audio decoding circuit is shown in Figure 4. The dual audio signal input point is connected to the collector V1 of a triode. When V1 is turned on, the dual audio signal sent from the telephone line enters the CM8870. If the CM8870 receives a valid DTMF signal, it decodes the corresponding 8421 code and outputs it from the data output terminals Q1 to Q4. The data enters the MCU PO.0 to P0.3 port to complete data collection, judgment and processing. In addition, the status signal coming out from the 15th pin of CM8870 enters the P2.7 port of the microcontroller, and informs the microcontroller to read the data.

CM8870 circuit diagram

2.2 SCM control process

The single-chip microcomputer controls the exchange to constantly monitor whether there are off-hook and on-hook actions in the communication link. The off-hook and on-hook circuit is actually an electronic switch that controls the connection between the circuit board and the telephone line. Normally, this switch should be in the off state, so as not to cause the telephone line to be busy; when remote control is required, if the ringer rings 5 ​​times and no one answers, then the circuit board and the telephone line need to be connected, that is, the picking is completed Machine action. V1 is an electronic switch, the conduction of this switch is controlled by the P1.4 port of the microcontroller. If the off-hook and on-hook circuit is designed with a relay, the circuit is simpler, but in practice, it is found that the power consumption is large, and the 5V relay draws up to 30μA, and the relay is also prone to spark interference. Using transistor off-hook circuit to overcome these problems.

The software design flow chart is shown in Figure 5.

Software design flow chart

When the MCU controls the CM8870 as the calling party, the MCU must first initialize the CM8870, and then control the off-hook circuit to pick up the phone. After receiving the dial tone of the called party, the MCU controls the ring current generator to generate a ring as the calling party call. After waiting for a while, see if the other party picks up. If the other party goes off-hook, the communication starts, otherwise it hangs up and the communication ends.

When the relay is the called party, after starting the MCU, the program must first initialize the CM8870, and then detect whether there is a ringing tone at any time. If there is, the MCU controls the off-hook circuit to take the initiative to off-hook and wait for a while to ensure that the off-hook After that, the single chip microcomputer controls the ring current generator to generate ringing, which is called as the calling party. After a period of time, complete the call transfer function, hang up, and end the communication.

3 Conclusion

This system is based on SM8951 microcontroller and CM8870 dual-tone multi-frequency decoder chip to realize the function of small industrial control switch. The small switch can be used for remote data transmission of industrial control network using power line or twisted pair as the transmission carrier, according to PSTN public telephone exchange network protocol and signaling Standard, using circuit switching principles to achieve switching functions. The small switch can be placed in the repeater of network communication or in the data processor at the end. Usually, the switch is only responsible for forwarding data and establishing a transmission link for data communication. The transmission of data in the switch is bidirectional of. The switch is not the final destination of the data, but just a "post". Although with the development of digital communication technology, the switching technology is becoming more complex and the switching function is becoming more and more perfect, but for industrial control networks, circuit switching technology based on wired networks is still widely used for its low cost, easy implementation, high safety and reliability, etc. use.

Welcome to reprint, this article comes from the electronic enthusiast network (http: //)

Wax Device

E-cig as a substitute of tobacco mainly reminds people of its potential benefits for health. Four ingredients contain in the e-liquid : propylene glycol, glycerin vegetable, nicotine and food grade essence. Nevertheless, smoke from cigarette contains carbon monoxide, tar, arsenic, ammonia, and many other cyanide and acetone.


Advantage


  • New ceramic self heating element, Uniform heating
  • High reduction, Temperaturecan be accurately controlled
  • Safety and Health, Worth a product,Natural and realistic taste,Factory Direct Sale
  • Using proprietary technology,Quality assurance, trustworthy
  • Oil leakage free, compact, pocket-sized, portable and easy to transport
  • So that smokers can smoke addiction, refreshing, to meet the psychological and physiological needs of smokers, and in line with the habit of smokers for many years.
  • Compared with rechargeable e-cigarettes and mechanical e-cigarettes, the price of disposable e-cigarettes is much lower, which is applicable to a wider range of customers than the first two. It is also the absolute truth for ordinary consumer groups to be cheap.


Wax Device Oem,Thc Wax Device Oem,Marijuana Wax Device Oem,High Cost Performance Wax Device

Shenzhen MASON VAP Technology Co., Ltd. , https://www.disposablevapepenfactory.com

Posted on