Design and implementation of intelligent data communication card for wireless stations

Publisher:pingbashouLatest update time:2006-05-07 Source: 电子技术应用 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

    Abstract: This paper introduces the design ideas and implementation methods of an intelligent data communication card for radio stations controlled by OKI's FSK MODEM chip MSM7512B and AT89C51 microcontroller. Through this card, data communication functions can be easily added to radio stations that use analog voice communication, greatly improving their cost performance.

    Keywords: radio station microcontroller data communication modem

In today's information age, people need a variety of communication means and equipment. Commonly used wired telephones or wireless stations are analog channels, suitable for transmitting modular voice signals. At present, the technology for computer communication through public telephone networks has matured. The characteristic of radio stations is that they are old-fashioned radio stations. They are widely used in our country and have a large number of owners. However, their functions are single and cannot adapt to the current requirements of data communication. How to carry out technical transformation on them and add data trust functions is particularly necessary. . To this end, an intelligent data communication card for radio stations (hereinafter referred to as the communication card) has been researched and designed. Through this card, data communication functions can be added to radio stations that use analog communication as voice communication, which greatly improves the cost performance of old radio stations. The card is small in size and low in cost and can be placed inside the radio station.

1 Design ideas of communication card

Considering the actual working conditions of the radio station, after adding data communication function to the radio station, attention should be paid to solving the following problems:

·Cannot affect the original voice communication function.

·The data interface of the data communication card should adopt a standard interface. Considering the performance, size, anti-interference and economy of the radio, the RS-232C standard interface is selected, and the corresponding serial rate is 1200bps.

·After the data to be transmitted is sent to the communication card, it should be converted into an analog signal suitable for transmission on the wireless analog outage, and the frequency bandwidth of the signal cannot exceed the bandwidth required by the radio channel.

·In order to solve the problem of co-channel interference that occurs when multiple users communicate at the same time, it is necessary to add a ban on receiving and sending functions to the radio.

2 Hardware block diagram and circuit design of communication card

The communication card designed based on the above ideas includes two parts: hardware and software. The hardware part is the basis of the card, and its block diagram is shown in the dotted box in Figure 1. Among them, PTT is the radio keying signal (PTT=1 radio receiving, PTT=0 radio transmitting), SQL is the radio receiving squelch signal (SQL=1 radio channel is busy, SQL=0 radio channel is idle), MIC is the radio voice signal Input port, UΩ is the voice signal demodulated by the radio station. The core of the entire communication card is the control system composed of 89C51 microcontroller, RAM and 8251. This part mainly completes the control and management of data reception, storage and transmission. The serial interface part consists of RS-232C interface and level conversion circuit. There is also a part, the MODEM circuit, which mainly completes the modulation and transmission of the digital signal (TXD) from the communication card to the radio and the demodulation and reception of the analog signal (FSK out) from the radio to the communication card. In Figure 1, the serial ports (TXD and RXD) of 89C51 are connected to the radio voice interface through MODEM. The reason why 8251 is used in the figure to expand the serial port of 89C51 to communicate with an external computer is to consider using 8251's RXRDY (14-pin "receive ready" signal) to connect to the 89C51 external interrupt (P3.2 pin), so that the 89C51 microcontroller It can respond to 8251 communication interrupts in time to avoid confusion with the serial interrupts of the MODEM interface or interrupt competition.

2.1 RS-232C serial interface design

The RS-232C serial interface and level conversion circuit are shown in Figure 2. Among them, MC1488 and MC1489 are level conversion chips. After the external computer data is input through the DB9 socket, it needs to convert the RS-232C level to the TTL level through MC1489, and under the control of 89C51, it is stored in the RAM communication buffer through 8251. Similarly, the data received from the radio station and temporarily stored in the RAM must be sent to an external computer, and the TTL level must be converted into RS-232C level by MC1488.

2.2 MODEM circuit design

The MODEM circuit is designed using OKI's FSK MODEM chip MSM7512B. Its interface output is compatible with TTL levels, and the working mode can be set by external logic. The working state of this circuit adopts 1200bps half-duplex mode, and the FSK frequency shift frequency complies with the standard protocol ITU-T V.23[2]. The MODEM application circuit in this card is shown in Figure 3.

Since the MODEM works in a half-duplex state, only one end of the AI/AO has analog signal input/output at the same time, and the MODEM has a built-in impedance mixing circuit, so its two ends pass through a 600Ω resistor and are used as one end. The AOG terminal is connected to digital "0", so that the analog transmit signal amplitude is a typical value of -4dBm (0dBm=0.775Vrms). The working mode of MODEM is selected through the P1.3 logic of the 89C51 microcontroller. Connect the MOD2 pin of the MODEM to the number "0", and the MOD1 pin to P1.3 of the 89C51. When the P1.3 output is "0", MOD1, MOD1 = "00", the MODEM works in the 1200bps transmission mode; conversely, when P1.3. When the 3 output is "1", the MODEM works in 1200bps receiving mode.

MODEM converts the received FSK analog signal into a digital signal (RXD) and outputs it to the 89C51 serial port. Once the 89C51 serial port receives a frame of data, it will immediately trigger a serial port interrupt, enter the serial port interrupt service routine to receive data, and temporarily store the received data in the communication buffer. Similarly, the data (TXD) transferred from the microcontroller 89C51 needs to be sent to the radio station via the MODEM. The RS end of the MODEM can be set to an active level (low level) through P1.4 of the microcontroller to allow transmission, and at the same time, Set P1.3 to "0" to make it work normally.

2.3 Design of communication card control system

The communication card control system circuit is shown in Figure 4. In addition to completing data transmission control, the 89C51 microcontroller is also responsible for completing the detection of the radio station SQL (squelch signal, also connected to P1.2 of the microcontroller) signal and the radio station PTT key control (completed by P1.1).

The P0 port of the microcontroller is latched and output by the address latch 74LS373 as the lower 8-bit address of 6264. The upper 5-bit address of 6264 is provided by P.0~P2.4. The P2.5 pin is used for chip selection. Connect the 6264 Chip select terminal CE. The read/write enable signals OE/WE of 6264 are respectively connected to the read/write enable signals RD/WR of the 89C51 microcontroller. P0 is a time-division multiplexed bidirectional data bus, which sends the data accordingly to the data terminal of the sum 264. The addressing space of D0~D7.6264 is 8K, from 0000H~1FFFH.

The clock of the microcontroller is 7.3728MHz, and ALE is used as the clock signal of 8251. However, since the ALE pulse of 89C51 will skip one when accessing the off-chip data memory, ALE is combined with WR and RD to compensate for the clock pulse that skips. After combination, a 1.228MHz pulse signal is generated, which is connected to the CLK of 8251 and divided by 64 as the receiving and transmitting clock of 8251. The frequency division by 64 uses two 74LS160s (connected in octal counting mode) cascaded.

The external interrupt INT0 is used as an interrupt request signal when the radio transmits data. In Figure 4, the external interrupt request signal is added to the INT0 pin of the microcontroller through the D flip-flop. When the external interrupt signal causes the CLK terminal of the D flip-flop to change positively, because the D terminal is grounded, the Q terminal outputs 0 and issues an interrupt request to the microcontroller. After the CPU responds to the interrupt, it uses the port line P1.5 as the response line. Use two instructions in the interrupt service routine to cancel the interrupt request.

ANL P1, #0DEH

ORL P1, #20H

The first instruction sets P1.5 to 0, while the status of other bits in port P1 remains unchanged. Since P1.5 is connected to the set-1 terminal S, the D flip-flop Q=1 and the interrupt request signal is cancelled. The second instruction changes P1.5 to 1, so S=1, so that new external interrupt request signals generated in the future can apply for interrupts from the microcontroller.

DTR and DSR are used to detect whether the external computer is idle. In the program, set the first bit of the operation command word to 1 to make DTR valid. Before sending data, read the status word first and check whether its highest bit is 1. If it is 1, it means the data device is ready and 8251 can send data. Otherwise, query again until it is 1.

3 Software design of communication card

3.1 Communication protocol

(1) The 89C51 microcontroller serial port in the communication card works in multi-machine communication state (ie SM2=1). Each card has a unique address number, ranging from 00H to FEH.

(2) The frame format of the serial port data of the communication card microcontroller is: 8-bit data + 1-bit data/address identification bit + 1-bit start + 1-bit stop bit. When the data/address identification is 0, it means that the transmitted frame is data, otherwise it is an address. The serial communication baud rate is 1200bps. Before transmitting data, the sender selects the address number of the receiver. After the receiver determines that it is the local address, it clears SM2 to 0 to receive all subsequent information. Otherwise, if it is determined that it is not a local address, the SM2=1 status will still be maintained and returned.

(3) The 89C51 microcontroller is usually in the query state of detecting SQL. By detecting the SQL signal, only one communication card is sending data by the software signal task clock. This will not cause channel competition during communication and avoid co-channel interference.

(4) The working mode of the microcontroller serial port is set to mode 3. In addition, after the external computer data is sent to 8251, the interrupt signal (RXRDY of 8251) is sent to the INT0 pin of 9C51, causing the microcontroller to generate a receiving interrupt due to external interrupt 0.

(5) The data packets transmitted by the 89C51 serial port adopt the cumulative check method. The program sets 16 bytes as one page. Each time it receives/sends one page of data, it controls the receiving/sending of an accumulated sum.

(6) The data format for asynchronous communication between the 8251 in the communication card and the external computer is: 8-bit data + 1 stop bit + 1 even parity bit. The baud rate is 1200bps. And when transmitting data, an 8-bit data packet length information word should be transmitted first.

3.2 Communication solution

(1) The process of sending external data via the communication card: After the data packets transmitted from RS-232C are serial/parallel converted by the 8251 chip, they are temporarily stored in the communication buffer with 6264 as RAM, and the radio channel is confirmed by detecting SQL When idle, the data packet in the communication buffer is sent to the MODEM circuit through the serial port to convert it into a signal TXA suitable for transmission on the wireless analog channel, and is sent out by the radio station.

(2) The process of data reception by the communication card: The RXA signal received by the radio station is converted into a digital signal RXD through the MODEM circuit, and is stored in the communication buffer by the microcontroller. The 89C51 microcontroller queries the external computer connected to the RS-232C port by detecting the status word and sends the data packet to the external computer via the 8251.

3.3 Software flow chart of communication card.

The entire working process of the communication card is controlled by software. The flow charts are shown in Figure 5, Figure 6 and Figure 7.

Using microcontroller and communication technologies, we designed and implemented intelligent data communication cards for wireless stations. Through this card, computer data communication functions can be added to the old-fashioned radio stations produced in the early days that can only be used for voice communication. With slight modifications to the software and hardware, functions such as selective calling, group calling, and group calling can also be added to the radio, thereby greatly improving the cost performance of radio stations, especially old-fashioned radio stations. This card is used in a certain wireless data transmission system and works well. The card is also widely used in the establishment of computer wireless communication networks, Yuancheng control systems, security systems, etc.

Reference address:Design and implementation of intelligent data communication card for wireless stations

Previous article:A basic chaotic modulated voice secure communication system
Next article:Frequency hopping communication and its applications

Latest Industrial Control Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号