Multi-channel telephone recording system based on USB cable

This article refers to the address: http://

Abstract Implementation multi-channel telephone recording system based on universal serial bus (USB) is. The system uses a high-performance C8051F320 microcontroller with integrated USB controller as the control chip, and the hardware is simple to implement. The software is developed and designed by the USBXpress software package provided by Silicon Laboratories, which is convenient and fast, and the recording effect is very good.
Key words Universal Serial Bus (USB) C805lF320 Multi-channel telephone recording USBXpress

1 Overview The recording system on the market can be roughly divided into two types: a telephone recording card and a telephone recording box. The telephone recording card is inserted into the computer motherboard slot in the form of a board and connected to the host. The installation is extremely inconvenient. Most of the recording cards are in the form of PCI slots, which are not only expensive, but also limited by the number of computer slots, addresses and interrupt resources, and are less scalable. Especially in an environment with strong electromagnetic interference, it is not possible to specifically shield it electromagnetically, which easily leads to data loss and distortion of sound. The telephone recording box is generally an external device, and is directly connected to the external interface of the computer through the interface line, which is very convenient to use; however, the interface provided by the computer is limited, and the traditional serial port is a point-to-point connection, that is, one interface can only support one device. And the serial parallel port generally cannot meet the real-time requirements of the system. In this case, using USB as the interface of the recording system is a good choice. Designing a telephone recording system based on USB interface technology, it can solve the above problems well by fully utilizing various superior conditions of the USB specification, and has the functions of supporting plug-and-play and convenient use, and has a broad market prospect.

This paper describes a method of implementing a multi-channel telephone recording system based on USB bus. The recording system uses a high-performance mixed-signal microcontroller chip C8051F320 as the controller core. The microcontroller integrates a USB controller to control USB transmission, which simplifies the design of the system hardware circuit. The software uses the USBXprcss software development kit provided by Cygnal/Silicon Laboratories for PC-side applications and microcontroller-side firmware. Programming of the program. This method makes full use of existing resources and is simple to develop and easy to implement. The recording system is in the form of an external recording box, connected to the USB interface of the computer, and connected to the telephone line to be managed, plug and play, no external power supply, hot swappable, easy to use. The recording system records the phone in a combination of software and hardware, and records the recording file on the computer hard disk, which makes up for the shortcomings of the traditional telephone recording, the inconvenience management, and the instability of the sound card collector recording.

2 system hardware implementation
2.1 USB Bus and C8051F320 Microcontroller Introduction
Universal Serial Bus (USB) is a new bus interface technology developed in recent years, with its low cost, high speed, easy expansion, support for hot swap and plug and play. A series of advantages, such as rapid development. The USB interface has become the standard interface of the PC, just like the serial port/parallel port. The maximum transmission speed of the USB2.0 interface is up to 480Mbps, which is much higher than the traditional serial/parallel interface, which can meet the most real-time transmission requirements of big data in most cases. The USB interface uses a tree topology. A USB interface can connect up to 127 devices. USB-based communication overcomes the IQR collision problem encountered in serial serial-to-port communication due to the use of its own reserved interrupts. In addition, the USB interface supports hot-swappable features, which greatly facilitates system development and practical applications; USB devices do not require a separate power supply, and only need to be powered by a computer or hub.
The C8051F320 is a mixed-signal Flash microcontroller with full-speed USB capability from Cygnal. The chip integrates 2304 bytes of RAM and 16KB of flash memory; it has faster processing speed and larger storage capacity, and has system programmable functions. In fact, the C8051F320 is a complete small system-on-a-chip (SoC).
The C8051F320 has the following features:
â—‡ Full speed USB2. O function controller;
â—‡ Supports 8 USB endpoints;
USBUSB buffer with lKB;
数据Integrated USB transceiver data transceiver, no external pull-up resistor is required in the design;
â—‡ High-speed enhanced 805l MCU core, the MCU core uses a pipelined instruction structure, processing speed up to 25MIPS (clock frequency is 25MHz).
Based on the above characteristics, the recording system uses the C8051F320 microcontroller chip.

2.2 The hardware of the
system constitutes a recording system to realize simultaneous recording of four telephones. The overall framework of the system is shown in Figure 1.

The inside of the recording box is a single-chip system with C8051F320 microcontroller chip as the core; it is connected to the host through USB cable; the four ports P0~P3 of the microcontroller chip are used to input the DC signal generated by the telephone line to obtain the status of the telephone line. The four ports P4 to P7 are used to input the AC signal generated by the telephone line, that is, the voice signal, and then converted into a digital signal by the A/D converter as the recording data transmitted by the USB.
The A/D converter used in the system is internally integrated with the C805lF320 microcontroller and has 10-bit accuracy with a maximum sampling rate of 200ksps.

3 System Software Implementation The software of the system is based on the USBXpress software development kit provided by Silicon Laboratories. USBXpress provides application interfaces through dynamic link libraries and library functions. Since USBXpress already provides device drivers, the main tasks of development are the development of the lower computer firmware program and the host computer application.

3.1 USBXpress Software Development Kit
    The USBXpress software development kit includes Windows device drivers, INF driver installation files, host interface libraries (available as Windows DLLs), and device firmware interface libraries.

The host application and device-side firmware programs can be easily programmed through these host and device interface functions.

3.2 Implementation of the device firmware program The
system selects Keil C as the firmware development environment and uses a combination of C language and assembly language.
The firmware program designates the firmware for the USB function as a complete interrupt driver. The data exchange between the ISR (Interrupt Service Routine) and the background main program is performed by event flags and data buffers. The main loop is responsible for initializing I/O ports, timers and interrupts, and reconnecting to the USB bus, and then detecting event flags to handle various events. The background program is written in C51 high-level language, and the A/D conversion completion interrupt subroutine is written in ASM51 assembly language.
The firmware program calls the firmware interface function provided by USBXpress to implement the function of transferring data via USB, and defines an interrupt service function with interrupt number 16 in response to the USB interrupt. The ISR is called as follows:


The main job of the firmware program is to convert the incoming 4-channel telephone analog signal into a digital signal through A/D conversion for transmission and storage. The program uses the timer 0 overflow to start the A/D conversion mode, and sequentially samples the AC channel (channels 1, 2, 3, 4, voice signals) at a certain sampling rate (11 025 kbps), and DCs at regular intervals. Channels (channels 5, 6, 7, 8, phone status) are sampled. The A/D conversion completion interrupt subroutine is written in assembly language and its general framework is:


3.3 The design system of the upper computer application program uses Visual C++6.0 to develop the upper computer application. The program uses the idea of ​​multi-threading. The main thread is the user interface thread, which is responsible for the interaction between the application and the user. In addition, a worker thread is opened for USB data transmission. The application first obtains the number of USB devices currently connected by the interface function F32x_GetNumDevices() provided by USBXpress. Then, according to the obtained identification number, the corresponding device is opened by the interface function F32x_Open(), and the handle of the device is obtained as the identifier of the USB device. The handle is unique in the program towel. In this way, you can call the F32x_Read() and F32x_Write() interface functions to read/write devices and control the transfer of data. In order to accurately read the recorded data, USBX-press provides the interface function F32x_CheckRXQueue() to return the number of bytes in the device receive queue to ensure error-free transmission of the recorded data. Recorded data is stored in the PCM format on your computer's hard drive.

Conclusion The telephone recording system was developed based on the USBXpress software development kit provided by Silicon Laboratories. The development and debugging is simple and fast, and the four-way telephone is simultaneously recorded, the recording is clear, and the telephone monitoring function is realized. Through the debugging test of USB-based multi-channel telephone recording system, it proves that it not only realizes the basic recording function, but also achieves a good recording effect, and overcomes the defects of the traditional methods in the past, realizing the true meaning of the interpolation. It is very convenient for users to use.

Round Rope Light

Round Rope Light,Neon Light,Multi Color Rope Light

Kingunion Lighting Co., Ltd. , http://www.sz-ledlight.com

Posted on