Second International Conference on the Digital SocietySecond International Conference on the Digital SocietySecond International Conference on the Digital SocietySecond International Conference on the Digital Society Second International Conference on the Digital SocietySecond International Conference on the Digital SocietySecond International Conference on the Digital SocietySecond International Conference on the Digital Society
Design And Implementation Of Embedded Data Acquisition System Based On USB And Flash Multimediacard Memory
Zhiyong Zhang, Tiejun Lu, Xiaobin Chu, Yamin Zhang
Abstract—Main research in this paper is the DA(data
acquisition) system design which based on the USB and MMC.
According a USB's chip correlation hardware information,
USB protocol, DA systematic structure and singlechip
computer information, a hardware development solution was
come out in the design. This solution consists of the data
acquisition module hardware development design, singlechip
computer data acquisition program development , USB's
installation interface design and debug, embedded
software(SW) and file system design. Finally we achieves the
DA system which is more speedly, without delay and more
dependable .
Index Terms—USB, Enbedded system, Data Acquisition
System, HW/SW co-design
I. INTRODUCTION
C
C
urrent statistical evaluation indicates that over 90
percents of worldwide computers are embedded
systems. Embedded devices are found at home, in medical
instrumentation, air traffic control systems and more. At the
same time, USB(Universal Serial Bus) which supports the
feature of PNP and hot-swap, with a high transfer speed and
low price has been widely used in digital products, and is
expected to be the interfacing standard of PC peripherals,
with a bright future in communication and industrial
application. However, today, most of devices are low-speed
USB systems, such as USB keyboard, USB mouse and so
on. When comes to the field of data acquisition, we can also
find some based on the USB interface, but most of them take
use of the subsistent data acquisition chips, that’s just simply
application of the USB protocol. There are many
disadvantages of them such as low speed, fixed acquisition
rate, complicated programme and difficult to modify the
program and so on. What is more, most of the systems are
disjunct with PCs, that means it is more difficult for
real-time data analysis. This paper describes the Embedded
Manuscript received August 27, 2007. This work was supported in part
by BeiJing Microelectronics Technology Institute.
Zhiyong Zhang is with the BeiJing Microelectronics Technology
Institute, BeiJing. 100076 China. phone: (+86)010-67968115-8718; e-mail:
zhiy66@163.com.
Tiejun Lu is with BeiJing Microelectronics Technology Institute,
BeiJing. 100076 China. e-mail: lu_tie_jun@163.com
Xiaobin Chu is with BeiJing Microelectronics Technology Institute,
BeiJing. 100076 China. e-mail: chxibin@163.com.
Yamin Zhang is with HeBei Technical college of petroleum profession ,
HeBei. 065000. e-mail: yamin66@126.com
system of data acquisition based on USB and MMC
(Multimediacard). The system using the USB interface SIE(
designd by verilog HDL) with the universal embedded
microprocessor 8051 controls the data acquisition process
between the MMC (Multimediacard) and computer can
overcome the drawbacks described above.
On the other hand, the data acquisition system have a
small removable flash MultiMediaCard (MMC) memory
can operate in a more convenient way in terms of operating
noise, failure rate, and recording quality. The data
acquisition system considered in the study is compatible
with the commercially available flash card readers and
operating systems so that the expensive dedicated retrieving
devices, which have no open standard, would not be
required. By using the flash memory as storage medium of
digital data, the problems due to analog recording are also
eliminated.
In the first part of the paper, the basic block diagram of the
hardware design is presented while the following part
underlines main considerations of data acquisition and data
transfer to the storage unit in the software development
phase together with the design constraints.
II.HARDWARE DESIGN OF THE SYSTEM
The data acquisition system mainly consists of three
hardware modules and one software module as given below:
1) USB interface
2) Data acquisition & microcontroller
3) Flash MultiMediaCard memory
4) Embedded SW
The main hardware modules on the system are composed
of the single-cycle 8051 microcontroller and a flash
MultiMediaCard interface and the USB interface. The
system block diagram is shown in Fig.1.
Fig.1 system block diagram
0-7695-3087-7/08 $25.00 . 2008 IEEEDOI
310-7695-3087-7/08 $25.00 . 2008 IEEEDOI
310-7695-3087-7/08 $25.00 . 2008 IEEEDOI 10.1109/ICDS.2008.19310-7695-3087-7/08 $25.00 . 2008 IEEE
DOI 10.1109/ICDS.2008.19
31
Authorized licensed use limited to: GUILIN UNIVERSITY OF ELECTRONIC TECHNOLOGY. Downloaded on April 21,2010 at 14:25:51 UTC from IEEE Xplore. Restrictions apply.
B. data acquisition [4]
In our system, the analog input driver circuit is designed
as follows(Fig 2):
Fig. 2 the structure of the data acquisition module
the analog signal is inputed by the voltage follower, so it
can be taken as a voltage source. This structure can satisfy
the current requirement of the A/D converter’s ports in the
ADuC812 [3]. The main function of the RC circuit in the
structure is that it can bate the impact when convert channels
and ensure the input current of ADC.
C.Universal Serial Bus Basics
The Universal Serial Bus (USB) is currently the most
diffused peripheral-to-PC connections standard thanks to its
flexibility, expandability, and ease of use. Among its main
features, the two most famous ones are that so called
“Hot-Swap” and “Plug and Play.” The “Hot-Swapping”
allows the user to attach and detach a USB peripheral at any
time without the need to shut down and restart the PC while
thanks to “Plug and Play” the PC operative system (OS) is
able to automatically detect the USB peripheral, configure it,
and load the suitable device driver. USB is a polled bus with
a host centric architecture: the PC host is always the master
device and manages all data and control signals over the bus.
Multiple devices can be connected together on the same
USB bus forming a broadcast network: using external hubs,
up to 127 USB devices can be plugged in a six tiered, star
topology configuration. A simple four-wire cable is used to
connect the USB devices to the host (or hub): two wires are
needed for data while the other two distribute electrical
power to the peripherals with a maximum of 500 mA (5 V
dc) for each device. Bus powering is another important USB
benefit because it eliminates the need of external supply
circuits for most USB devices. The maximum cable length
of 5 m is sufficient for most desktop applications but it can
be extended up to 30 m using external hubs. Several data
rates are supported in order to optimize different speed
peripheral connection as summarized in Table I.
Data rates for different speed class device
revision LS FS HS
V1.1 1.5Mb/s 12Mb/s -----
V2.0 ------12Mb/s 480Mb/s
Table I USB data rates
Four data transfer types are supported: Control, Bulk,
Interrupt, and Isochronous. Control transfers are needed for
configuration, setup and command phases. Bulk transfers
are used to move large amounts of data while Isochronous
transfers are useful for audio and video applications where
timing is critical. Finally, Interrupt transfer are used for slow
peripherals, like keyboard and mouse; in this case the host
PC polls the peripheral at a constant rate searching for
receiving or sending data requests. The Low Speed devices
can handle only control and interrupt transfer modes. USB
communications take place between the host and special
buffers, called endpoints, located into the peripherals. Each
endpoint has a unique address and is actually the
source/receiver of data.Within each device the endpoints are
numbered starting from 0 up to 15: the first one, called
endpoint 0 (EP0), is normally reserved for control transfers
while the other are used for data transfers. USB
specifications allow Low Speed devices to have up to two
endpoints other than EP0. By the software point of view, the
latest OSs support many USB devices classes that is groups
of devices with similar characteristics, like mass-storage
devices or audio devices. Each class can be controlled by a
general class driver so the advantage is that if one device fits
neatly in one of this predefined classes the user does not
need to write his own custom device driver. More related
informations are available at the official USB website
www.usb.org. ([1],[5],[6])
In our design, we introduced a SIE module which designd
in verilog HDL and debuged on the FPGA takes charge the
communications between the device and any PCs. The
module provides a USB function controller that has been
certified compliant with the USB 2.0 specification for
high/full-speed (480/12 Mbps) functions. So the speed is
quick enough for real time data transmission.
D.The microcontroller
The system design is based on the Single-cycle 8051
microcontroller .its feature is shown below:
1) Internal 30-MHz operation frequency for energy saving
dynamic power management.
2) 32K-byte masked program ROM and (6K+256) byte data
SRAM.
3) Built-in master I2C and UART/RS-232 interface for
external device communication.
In this system, C is used as the programming language
and the compiler from Keil Software is used for all
programming design.Keil's simulator, which is included
with the compiler, is a good high-level language debugger
but does a poor job of simulation at the hardware software
interface. This constraint led us to consider a combination of
a Xilinx FPGA and an 8051 with either EPROM or RAM for
program storage and some minimum amount of additional
I/O. At this point in time we can write our software and
debug it using the Keil compiler and debugger. And we can
also expand the 8051 and develop special purpose
peripherals using powerful design automation software tools
and the onboard FPGA.
E. MultiMediaCard
Flash memory is an ideal storage medium for portable,
battery-powered devices because it features low power
consumption and it requires no power to maintain the stored
data with its non-volatile attribute. It also has a relatively
wide operating range subjected to temperature, shock and
vibration.
The MultiMediaCard (MMC) is a very small, removable
flash storage device designed specifically for storage
applications that put a premium on small form factor, low
power and low cost. The cards are found some applications
for data storage in small mobile devices including
next-generation mobile phones and PDAs, and portable
32323232
Authorized licensed use limited to: GUILIN UNIVERSITY OF ELECTRONIC TECHNOLOGY. Downloaded on April 21,2010 at 14:25:51 UTC from IEEE Xplore. Restrictions apply.
imaging products such as digital cameras.
Fig. 3 MultiMediaCard Architecture
Fig.4 MultiMediaCard Controller Scheme
The flash MultiMediaCard is one of the smallest
removable storage card available on the market today. It
only weights 1.5 grams and considerably small in size
( 32mm× 24mm ×1.4mm ). Currently they have the
capacity up to 1 GB and only 3 or 4 active lines are required
to interface it to the host depending on the operation mode
selected [2]. This significantly decreases the cost and the
complexity of both connector and interface circuitry.
The MultiMediaCard includes both the flash memory
modules and an on-card intelligent controller as simplified
in Fig.3 and Fig.4. The latter performs interface protocols,
data storage and retrieval, error correction code (ECC)
algorithms, defect handling, power management, clock
control and communication with host.
To develop an embedded system with MultiMediaCard,
two kinds of software should be developed. A MMC device
driver to access the card and a file-system to classify the data
which will be detail described later.
III. EMBEDDED SOFTWARE DESIGN
Storing the continuously data on flash card memory are
important tasks performed by embedded software. This
embedded software is developed by using Keil compiler and
partially with assembly language. The interaction between
hardware and software layers are shown in Fig.5.
Fig.5 Interaction between hardware and software layers
A. software of device driver
The host which controls all communications sends
commands and receives a corresponding response from the
card. As sees in Fig.5, in hardware interface layer, data is
send to MMC in one byte length at a time. MMC command
layer uses the hardware interface layer to send commands in
6-bytes length to MMC and receive coffesponding responses
in 6-byte or 16-bytes(R1/R1b/R2/R3/R4/R5) length as in Fig.
6-Fig.8[2]. In higher command layer, the functions such as
initialization, block read/write, etc, are implemented.
Flash memory is a special type of EEPROM that can be
erased and reprogrammed in blocks instead of one byte at a
time. The smallest amount of data that can be transferred
to/from a MMC is a "block" which is similar to a sector in a
hard-disk or a floppy disk. The default block size is 512
bytes. Basic protocols for single block read and write
functions are shown in Fig.9 [2] and Fig.10 [2]. In an
optimised PC compatible file system layer, the data
locations on memory are organized according to selected file
format. User software saves the data in the file such a way
that it can be accessed later by any commercial card reader
compatible to PC file systems.
B. software of file system
The file system is a system that is used by an operating
system or a program to organize and keep a track of files.
The data on MMC can be organized in various ways.
Generally, MMC data is structured by means of a file
system. The file system can be implemented with two
different approachs:
Dedicated file system: The data stored on the flash card
memory can be accessed only with a special software and
hardware. A special flash card reader and a related software
should be developed to access the card data.
Common file systems: Most commercially available
hardware (i.e. flash card readers) and common software (i.e.
DOS/Windows) tools can be employed to access the files on
flash card. In this particular work, an optimised version of
PC-compatible file format system that is FAT16 was
implemented. When new data needs to stored on the MMC,
a new file in the format of FAT16 will be created.
33333333
Authorized licensed use limited to: GUILIN UNIVERSITY OF ELECTRONIC TECHNOLOGY. Downloaded on April 21,2010 at 14:25:51 UTC from IEEE Xplore. Restrictions apply.
Fig.6 MMC commands format
Fig.7 R1 format
Fig.8 R2 forma
Fig.9 block read
Fig.10 block write
IV. OVERALL SYSTEM
the advantage of the system can be summarized as
follows:
1) Small volume and light weight
2) The device is more robust and shock resistant because it
includes no moving lectro-mechanical parts (reliable and
silent operation during sleep mode)
3) Low power requirements (extended battery life)
4) The device has a flash program memory (so the program
run on the device can be updated whenever required)
5) All data stored on the flash card can be easily transferd to
PC for further analysis.
Fig. 11 transfering data from system to PC
6) Compatiblity with industrial open standards significantly
reduce total system cost:the data stored on the flash card,
only a standard PC and a commercially available low-cost
flash card reader are required.
V.CONCLUSIONS
In this study, we have designed a useful Embedded
System chip based on USB and Multimidiacard. The
memory unit in the device is a removeable small and light
weight flash card. Using a flash MMC card with PC file
system compatibility enable low total system cost. The
storage capacity is from 8M to 1G. At the same time, thanks
to the USB interface, the system is also capable of
performing real time processing and analysis.
Our design performs all basic operations on the chip.
First tests have shown a right electrical and logic behavior.
Thanks to USB features like Plug and Play and Hot-Swap, it
can be easily plugged to a common PC or notebook. The use
of a high-performances microcontroller with programmable
I/O lines and powerful integrated peripherals reduces the
number of electronics components, symplifies the project
the use of a faster microcontroller especially improved the
acquisition rate performance. After this intermediate step,
we will proceed with the development of the system for high
performance.
REFERENCES
[1]
Compaq Computer Corp., Intel Corp., Microsoft Corp, Philips Corp ,
NEC Corp. (April 27, 2000) Universal Serial Bus Revision 2.0
specification), [Online] Available: http://www.usb.org
[2] MMCA MultiMediaCard Association, MultiMediaCard System
Summary Version 3.2 January 2002
[3] Analog devices ADuC812 User’s Manual, 2000
[4]
B.Murovec, S.Kocijancic. “Educational data acquisition system with
USB interface”, EUROCON 2003 Ljubljana, Slovenia
[5]
Mindshare, Inc., D. Anderson, “Universal Serial Bus System
Architecture ”. Addison-Wesley Developers Press, U.S., 1997
[6]
Axelson, “USB Complete Everything You Need to Develop Custom
USB Peripherals”. Lakeview Research, Madison, 1999
[7]
Carl Staelin,Hector Garcia Molina. “File System Design using Large
Memories”. IEEE,1990
[8]
V.Fanti, R.Marzeddu, G.Piredda,P.Randaccio. “A Portable
Acquisition System Based on USB Standard for the Medipix2 X-Ray
Detector” IEEE transactions on nuclear science, vol.53, NO.5,
October 2006
34343434
Authorized licensed use limited to: GUILIN UNIVERSITY OF ELECTRONIC TECHNOLOGY. Downloaded on April 21,2010 at 14:25:51 UTC from IEEE Xplore. Restrictions apply.