Академический Документы
Профессиональный Документы
Культура Документы
USB bus
I.
INTRODUCTION
III.
8-bit ADC
AT89S51
PDIUSBD12
Host
SYSTEM HARDWARE
169
VCC
47uF
VCC
20
C6
C5
12
3
8
6
7
VDD
VrefVref+
CS
RD
WR/RDY
MODE
INT
OFL
DB0
DB1
DB2
DB3
DB4
DB5
DB6
DB7
9
18
2
3
4
5
14
15
16
17
P1.0
R8
10K
P0[7..0
P0.0
P0.1
P0.2
P0.3
P0.4
P0.5
P0.6
P0.7
89S51
PDIUSBD12
INT_N
ALE
DATA[7..0]
WR_N
INT0
ALE
P0[7..0]
WR
RD_N
10
P2.2
RD
WR
Vin
ADC0820
1
11
GND
Vin
R5
1K
0.1uF
RD
CLKOUT
XTAL1
CS_N
A0
P2.3
R9
10K
IV.
SYSTEM SOFTWARE
170
B. Driver Design
The equipment designed in this paper should realize the
self-defined read and write operation. Then new device class
is needed. So it is necessary to design the corresponding
driver. Driver Studio tools is used to write driver, under the
rules of WDM (Windows Drivers Model). When the
application needs to read data from the hardware, it calls the
standard Win32 API functions to achieve, such as
ReadFile(). While the Win32 subsystem modules (such as
KERNEL32.DLL) implement the API by calling the
platform-related system service interface, and the platformrelated service will call kernel mode to support routines.
All the kernel-mode I/O operations use a common data
structure (IRP, I/O request packet). The kernel sends each
kind of IRP to the WDM driver.
C. Application Design
LabVIEW is developed by NI (National Instruments) in
America. LabVIEW is a graphical programming
environment used by many engineers and scientists to
develop measurement, test, and control systems using
intuitive graphical icons and wires that resemble a flowchart.
LabVIEW offers unrivaled integration with lots of hardware
devices and provides lots of built-in libraries for advanced
analysis and data visualization. It includes lots of procedures
for data acquisition, data and signal analysis, and system
control. It is easy to design program by using this software.
And the program designed by it is easy to debug and
maintain. So it is used in the portable USB data acquisition
system to develop application.
LabVIEW is highly flexible. It provides powerful ability
in communicating with external programs, such as DLL, C
language, ActiveX, .NET, DDE, and Matlab [6]. In order to
speed up program development, DLLs can be called by using
the LabVIEW Call Library Function node. It is worth
mentioning that the data storage format of LabVIEW follows
the data storage format of C language, so users can pass any
kind of data structures to CINs. In addition, CIN has higher
efficiency than the graphical language in implementation.
The program frame using LabVIEW is shown in Fig. 7.
171
[2]
[3]
[4]
[5]
Figure 8. Interface of application program using LabVIEW
[6]
ACKNOWLEDGMENT
172