Low Cost DAQ final A - High Speed Digital Systems Lab

advertisement
Low Cost DAQ
FINAL semester A presentation
Presented By: Gabriel Heifets, Alex Zaprudsky
Instructor: Evgeniy Kuksin
Spring 2013
1
Goals
• Project Goal:
Implement a low cost DAQ with USB interface.
The DAQ features:
 8 analog channels with a sample rate of at least
10KS/s per channel.
 8 bi-directional GPIO channels.
 2 PWM signal generators.
2
Goals
• Project Goal:
Implement a flexible core functions to take
advantage of the all three interfaces (A2D, GPIO
and PWM) in NI LabView environment.
3
Goals
• Semester A Goal:
– Using TI MSP430F5529 dev board, Code
Composer Studio and TI MSP430 libraries, develop
firmware which will handle A2D, GPIO, PWM
routines and an USB communication.
– Develop an USB driver for a target PC workstation
– Using NI LabView implement a flexible core
functions for the multipurpose DAQ board.
4
Goals
• Semester B Goal
Build a complete multipurpose DAQ:
Create schematics design.
Design PCB layout and produce it.
Assemble all required parts for DAQ on the
PCB.
5
H/W Block Diagram
I/O
MSP-EXP430F5529 Experimenter Board
2 PWM
8 A/D
100 Mil
Header
MSP430F5529
eZ430 Emulation
8 GPIO
USB
PC
6
MSP-EXP430F5529
Experimenter Board
7
Principle of operation
• To implement the DAQ device, we used an
MSP430F5529’s GPIOs for collecting an analog
DATA and to generate the desired (GPIO and
PWM) output. Integrated ADC module will
convert the collected analog signals in to a
digital data. As a DAQ’s manipulator and a
data analyzer, we will use a PC workstation
powered with NI LabView. Thanks to the
integrated USB2 controller with PHY, we will
be able to achieve a 12Mb/s data link.
8
MSP430F5529
• 16-Bit RISC Architecture, 8+2KB SRAM, up to 25-MHz System
Clock
• An ADC with a 12 bit A/D conversion for collecting the analog
data
• Up to 43 GPIO’s for custom use
• 4 16-bit timers for setting an analog sample rate, and
generating PWM signal.
• Full speed USB with integrated PHY
9
MSP430F5529
10
MSP430F5529 Firmware Block Diagram
• USB CDC Driver – USB Com Device Class Driver. Used to handle the
USB communication between the MSP430F5529 and a PC
workstation. Implemented using the TI USB stack libraries
• Mode Selector – Decodes received request from user and activates
an appropriate DAQ mode with the desired parameters.
• GPIO – According to the user request, will assign a high/low state to
the desired GPIO, or will sense the GPIO’s state and send it over the
USB data link
• PWM - According to the user request, will generate a PWM signal
over two of the MSP430F5529 GPIOs. User can request a DC with a
1/1024 step. The two PWM signal are totally independent.
11
DAQ IO modules: ADC
MSP430F5529 ADC Block diagram
MSP430F5529 Firmware Block Diagram
• ADC – The ADC module will sense an analog
data from 8 MSP430F5529 channels and
convert it to a digital data. The analog to
digital conversion is performed with up to
27KS/s rate. The converted data will be sent
over an USB link with a user defined chunk
size, and up to a 256 samples per chunk. It is
up to the user to specify the requested analog
channels, a sample rate and the number of
samples per chunk
13
DAQ IO modules: ADC
• The ADC module perform 12-bit analog-todigital conversions. The module implements a
12-bit SAR core, and a 16-word conversionand-control buffer. The conversion-andcontrol buffer allows up to 8 independent
analog-to-digital converter samples to be
converted and sent over an USB data link
14
DAQ IO modules: ADC
1.
2.
3.
4.
5.
Main features
Up to 28KS/s sample rate per channel
Sample-and-hold with programmable sampling
periods controlled by software.
Conversion start\stop control
LDO on-chip reference voltage generation at 3V
8 individually configurable external input
channels
DAQ IO modules: ADC
Parameter
Value
Units
Analog input voltage range
0 ~ 3.6
V
CI
20
pF
tSAMPLE
1000
Ns
RI
10 ~ 1900
Ohm
Sample Rate
28
KS/s
DAQ IO modules: GPIO
Main features
1. 8 independent Schmitt-Trigger GPIO channels
2. Any combination of input or output
Parameter
Value
Unit
VIH
1.5~2.1
V
VIL
0.75~1.65
V
Ci
5
pF
VOH
3.75
V
VOL
0.25
V
tRISE
7.18
ns
tFALL
6.65
ns
DAQ IO modules: PWM
Main features
1. Two PWM independent channels @3.11KHz
2. DC @ 1024 step resolution
3. Software controls start/stop signals
Parameter
Value
Units
Frequency
3114
Hz
VOH
3
V
VOL
0.25
V
tRISE
82.5
ns
tFALL
133.8
ns
DAQ IO modules: USB
Main features
1. Full-speed USB2 device
2. CDC USB Class
3. Benchmarked* USB speed is up to 4Mbit
*According
to Programmer’s Guide: MSP430 USB API Stack for CDC
MSP430F5529 Firmware Block Diagram
(1) ADC
LabView
USB CDC
PC Driver
USB CDC
MSP430
Driver
MSP430
Request
Decoder
(2) GPIO
(3) PWM
20
MSP430F5529 Firmware Block Diagram
ADC request command
structure
Active ADC Channels:
0 – Channel is inactive
1- Channel is active
Number of samples to
perform, while Y=0~255
Delay between two samples:
35µs+80ns*X, while
X=0~999999
00000111000255001000
Sample channels active: 5,6,7
Sample channels inactive: 1~5
Number of samples: 255
Delay between samples: 115us
21
MSP430F5529 Firmware Block Diagram
GPIO request command
structure
Input\Output switch
‘A’: Get GPIO input status
‘B’: Change GPIO’s status/level
GPIO output logic level
0: GPIO logic level set to low
1: GPIO logic level set to high
2: GPIO sets as input
B10112211
GPIO access: set GPIOs level
GPIOs set to level high: 0,2,3,6,7
GPIOs set to level low: 1
GPIOs set as input: 4,5
22
MSP430F5529 Firmware Block Diagram
PWM request command
structure
PWM1 DC in 1
1024
steps
PWM2 DC in 1
1024
steps
Start/Stop PWM generator
1: Start PWM generator
0: Stop PWM generator
012807621
128
PWM1 DC: (
× 100)%
1024
762
(
1024
PWM1 DC:
× 100)%
PWM Generator: Started
23
Reference GUI design block diagram
Instrument
Panel
Prepares A2D
request command
Receives
measured data
from A2D
& transmits it
& Converts it
Reads data from port & converts it
Prepares & transmits Data out to
Port
Prepares 2 PWM requests &
transmits them
24
GUI block diagram description
All the blocks are designed in such way, that the
end user will be able to use them independently
for any custom application according to his needs.
Instrument panel:
 Chooses between 4 modes.
 Controls over in/out ports configuration, number of
samples, sample rate and PWM duty cycle.
 Continuously displays digital data received from A2D in
the Wave Graph.
 Displays data from GPIO.
25
GUI block diagram description
A2D request transmitter:
 Prepares request command according to number and configuration of
channels to sample from, number of samples and sample rate as
received (for example - from Instrument panel).
 Transmits A2D request to USB link via VISA interface.
Inputs:
• ADC channel (Boolean array) to choose channels to sample from.
• Number of Samples
• Sample Rate.
Outputs:
• N-Ch Out – 2D array of sampled data after conversion.
26
GUI block diagram description
A2D request
Vi
Inputs:
• ADC channel (Boolean array) to choose channels to sample from.
• Number of Samples
• Sample Rate.
Outputs:
• N-Ch Out – 2D array of sampled data after conversion.
27
GUI block diagram description
A2D data converter:
 Receives A2D sampled data from USB link via VISA interface.
 Converts received data accordingly to number of channels that
were sampled.
Inputs:
• String of sampled data from ADC.
• Channel – Number of channels were sampled.
Outputs:
• N-Ch Out – 2D array of sampled data after conversion.
28
GUI block diagram description
A2D data
converter Vi
Inputs:
• String of sampled data from ADC.
• Channel – Number of channels were sampled.
Outputs:
• N-Ch Out – 2D array of sampled data after conversion.
29
GUI block diagram description
GPIO In:
 Transmits read GPIOs status request to an USB link via VISA
interface.
 Converts received GPIOs status data, prepares it to be
displayed and sends it to Instrument panel.
Inputs:
• GPIO In String – read from Port request.
Outputs:
• Boolean array – data from Port .
30
GUI block diagram description
GPIO Read request
&
Data Converter
Inputs:
• GPIO In String – read from Port request.
Outputs:
• Boolean array – data from Port
31
GUI block diagram description
GPIO Out:
 Prepares data to write to GPIO.
 Protects from bi directional voltage apply by masking output
channels.
 Transmits write to GPIO request and data to USB link via VISA
interface.
Inputs:
• Boolean array – Output data to GPIO.
• Port direction array – enables Output direction for GPIO.
Output:
• Visa Out – Data string to the microcontroller via USB link.
32
GUI block diagram description
GPIO Out
Inputs:
• Boolean array – Output data to GPIO.
• Port direction array – enables Output direction for GPIO.
Output:
• Visa Out – Data string to the microcontroller via USB link.
33
GUI block diagram description
PWM :
 Prepares PWM control commands, e.g. duty cycles to be
generated by 2 independent PWMs and on/off PWM signal.
 Transmits PWM request/control command to USB link via VISA
interface.
Inputs:
• 2 PWM duty cycle controls.
• Boolean PWM On/Off control.
Outputs:
• PWM Control String to micro controller via USB link.
34
GUI block diagram description
PWM
control
Inputs:
• 2 PWM duty cycle controls.
• Boolean PWM On/Off control.
Outputs:
• PWM Control String to micro controller via USB link.
35
PWM transmit
Test Environment
• To measure the ADC conversion sample rate,
one of the available GPIOs was toggled at the
end of conversion routine. Then, the ADC
module was put into the endless conversion
mode, and the TP GPIO was sensed by the
scope to measure the generated square wave
frequency
36
Test Environment
Conversion time measurement, delay = 0 cycles
37
Test Environment
Conversion time measurement, delay = 100 cycles
38
PWM measurements
Duty Cycle = 720/1024 = 70.3%
39
PWM measurements
Duty Cycle = 320/1024 = 31.25%
40
Sampling 1kHz sin wave
41
FFT of a 3kHz sin wave
42
List of future improvements
• Add another 8 or more GPIOs
• Adding pull-up/down resistor options.
• Develop control center for mobile devices such as
android and/or iOS.
• Make a device compatible with ISO IP68
standard.
• Changing PWM frequency
• Extend number of maximum samples per request
43
Questions?
Thanks
44
Download