
Abstract: The USB-based ECG data acquisition system, given the principle of the system's hardware and software design. Because the system uses a high-performance USB ASIC CY7C64613, so easy to use, plug and play features. And notebook computers connected to constitute a mobile ECG detection of the instruments, the promotion of high practical value.
ECG is the most extensive clinical examination items. ECG data acquisition system is a key component of ECG examination, it can in a strong noise background, through the electrodes will be 0.05 ~ 100Hz ECG detected the faint, and then amplified, A / D conversion into a computer. The use of computers makes the system in signal analysis, storage, printing, etc. than the traditional ECG machine has a distinct advantage. But the collection system and a computer communication interface card plug trouble there, security is poor, and the limited number of expansion slots such as inadequate. ? this paper, this USB-based ECG data acquisition system using the USB interface, the most advanced technology to support Plug and Play and hot swap function. This is the other non-USB interface can not be compared. Also connected with laptop computers to form a mobile ECG detection analyzer.
2 System hardware components
2.1 System components
Figure 1 shows the USB-based ECG data acquisition system block diagram. Figure ? electrode ECG sensor detects the input protection circuit by limiting voltage, high frequency filter, then the preamplifier, and then by the optical isolation, the voltage is amplified again, and finally eliminate the interference by the interference suppression circuit after , in a multi-channel analog switch control signals to which an access A / D. CY7C64613 USB interface is a microcontroller with intelligent, which allows the A / D transfer the digital signal after the transfer to the computer through USB interfaces.
Here's the anti-jamming measures data acquisition system, signal amplification, and USB communication focuses on such issues.
2.2 The anti-jamming
ECG as a medical device data acquisition system, due to its low-frequency detection of objects, the faint of heart signals, interferences, so ? system safety and reliability of anti-interference ability and critical. In response, the system has taken various measures. Figure 2 shows the input protection circuit and high-frequency filter circuit. Input protection circuit which is inserted between each electrode and two parallel to the silicon diode for voltage limiter, which limits the input voltage does not exceed ± 600mv, to ensure the safety of patients and equipment. High-frequency filter circuit for preventing high-frequency interference signal into the data acquisition system. The design uses the FX101 chip as the core of the low-pass filter. Filter cutoff frequency is:
fc = 1 / [2p (R1R2C1C2) 1 / 2]
Use of optical isolation circuit and the circuit can be further improved interference rejection immunity. Interference suppression circuit including the 50Hz interference suppression circuit and electromyographic interference suppression circuit. The former is used to filter out 50Hz frequency interference (which is the main source of interference ECG), which is a passive RC two-T network. The latter is used to inhibit the introduction of electrodes in contact with the skin of the EMG signals, it is a high load RC filter.
In addition, the method can be applied to software filter. Can be set in software 50Hz interference filter and drift filtering program to further improve the system's noise immunity.
2.3 Amplifier
Is one of the main amplifier circuit design. Under normal circumstances, can amplify the ECG signal must be sent to a computer. The impact of the polarization voltage, the amplifier gain is not too high, so the system uses a pre-amplifier and voltage amplifier two amplification methods. The requirements of the preamplifier are: high input impedance, offset drift is small, common mode rejection ratio, input noise. Therefore, the author chose the INA121 chip. INA121 is produced by Texas Instruments BB instrumentation amplifier low power consumption, superior performance, and its differential input resistance of 1012O, common mode rejection ratio of 106dB, input offset voltage is ± 200µv, input offset drift is ± 2µv / ? , input noise is 20nV ? Hz ? 1 / 2. Magnification preamplifier is set to 50. Smaller magnification to avoid pre-polarization voltage. Voltage amplifier circuit to set a higher magnification (taken as 100 times), you can ensure that the total magnification.
2.4 USB dedicated chip select
Currently all manufacturers introduced many types of USB chips, different functions. The system selects Cypress Semiconductor has introduced the EZ-USB FX full series CY7C64613-128NC chip. EZ-USB FX series with a smart chip microcontroller USB interface, it is to 8051 as the core. Complex and cumbersome for USB communication, the device can provide EZ-USB firmware library and firmware architecture that can greatly reduce the difficulty of writing firmware code level. CY7C64613 USB protocol support 1.1, while support for 12Mbps full-speed transmission. In addition, it comes with an enhanced version of the 8051 core and 4kB or 8kB of RAM, the endpoint number to 32, can be intelligent USB core program.
3 Software Design
The system software design includes three parts: firmware design, driver design, application design.
The design of ECG data acquisition system will be planned as HID human interface device group. The group was originally for the HID keyboard, mouse and other input devices and setting and planning. However, the need for two-way, the appropriate frequency for data exchange with other devices, is also a very good design examples and infrastructure. Therefore, these devices can be planning for the HID group, as long as they meet the specifications defined in the HID various characteristics and conditions, you can perform HID devices. In windows98 and windows2000 operating system, such groups have been included HID driver, so when the user develop new devices, without rewriting the drivers.
3.1 firmware (Firmware) Design
Because EZ-USB FX series has provided a firmware architecture (frame works). Therefore, we can use this framework to simplify firmware development. Users only need to provide its USB descriptors and the peripheral functions of the program code to achieve the PERIPH.C file ? ?, to complete the set is fully compatible with the USB device. In addition, Cypress also offers the vice function hooks (function hooks), using this feature can help users design of the firmware.
After the program started, the firmware architecture will perform the following steps: first, set the starting value of the internal state variables; the second step, the user's initial setup function called TD-Init; the third step, re-equipment in 1s intervals list (ReNumerate), until the SETUP packet received to date; the fourth step, once the SETUP packet is detected, the firmware architecture work started immediately to work with distributors.
TD_Init () available to the user equipment (ie, data acquisition system) to initialize and re-address descriptor table. The code is as follows:
TD_Init ();
pDeviceDscr = (WORD) &DeviceDscr;
pConfigDscr = (WORD) &ConfigDscr;
pStringDscr = (WORD) &StringDscr;
if ((WORD) & DeviceDscr & 0xe000)
pReportDscr = (WORD) & ReportDscr
{
IntDescrAddr = INTERNAL_DSCR_ADDR;
ExtDescrAddr = (WORD) &DeviceDscr;
DevDescrLen = (WORD) & UserDscr (WORD) & De-viceDscr +2;
for (i = 0; i
* ((BYTE xdata *) IntDescrAddr + i) = 0xCD;
for (i = 0; i
* ((BYTE xdata *) IntDescrAddr + i )=*(( BYTE xdata *) ExtDescrAddr + i); ?
pDeviceDscr = IntDescrAddr;
offset = (WORD) & DeviceDscr_INTERNAL_DSCR_ADDR;
pConfigDscr-= offset;
pStringDscr - = offset;
pReportDscr-= offset;
}
EZUSB_IRQ_ENABLE ();
EZUSB_ENABLE_RSMIRQ ();
.
3.2 Driver
In the Windows operating system, USB driver is based on the Win 32 Driver Model ? WDM ?, it is the driver with the hierarchical model, each driver responsible for part of the communication level of work, the specific block diagram shown in Figure 3. Device drivers (including the group driver) the system can communicate with a bus driver, bus driver, to handle the USB hardware. User application does not deal directly with the hardware, but the use of Win 32 API calls to the Win 32 subsystem function calls, and sent to the device driver I / O request packet (IRP). Since Windows operating system already contains some of the bus driver and the driver group, so users only need to write your own user selection of Windows device driver or the driver can be provided by the group.
In Windows systems, HIDDEV.INF file group has been providing HID driver, you can directly reference. Thus eliminating the need for users to write complicated driver trouble.
3.3 Application Design
In the application, the need to set the firmware and drivers with the same PID / VID code can be found in the corresponding device management USB device (Data Acquisition System). Set specific code as follows:
Const MyVendorID = & H1234
Const MyProductID = & H5678
In Windows 98 Driver Development Kit (DDK), in general, have a user mode (that is, application level) HID communication part of the complete guidelines. The user by calling the API function, you can find inside the device descriptor set VID / PID codes correspond to the HID devices (ie data acquisition system). With API function returns the device path name, you can use GreateFile () function to open the device's instructions (handle), then use the HID API function to read a specific VID / PID codes, and finally use the ReadFile () and WriteFile ( ) function to prepare the exchange of data. Specific programming can be found in Windows 98 DDK.
4 Conclusion
USB-based ECG data acquisition system has superior performance. Tests showed that its easy to use, performance and stability. Especially in combination with a laptop it may constitute a mobile ECG detection analyzer to be easily applied to the field, ambulance, ward and other traditional ECG analyzer inconvenient to use the occasion to promote a high practical value.