440 likes | 671 Views
Low Cost DAQ FINAL semester A presentation. Presented By: Gabriel Heifets, Alex Zaprudsky Instructor: Evgeniy Kuksin Spring 2013. 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.
E N D
Low Cost DAQFINAL semester A presentation Presented By: Gabriel Heifets, Alex Zaprudsky Instructor: Evgeniy Kuksin Spring 2013
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.
Goals • Project Goal: Implement a flexible core functions to take advantage of the all three interfaces (A2D, GPIO and PWM) in NI LabView environment.
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.
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.
I/O MSP-EXP430F5529 Experimenter Board 100 Mil Header MSP430F5529 2 PWM H/W Block Diagram 8 A/D eZ430 Emulation 8 GPIO USB PC
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.
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
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.
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
DAQ IO modules: ADC • The ADC module perform 12-bit analog-to-digital conversions. The module implements a 12-bit SAR core, and a 16-word conversion-and-control buffer. The conversion-and-control buffer allows up to 8 independent analog-to-digital converter samples to be converted and sent over an USB data link
DAQ IO modules: ADC 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: GPIO Main features • 8 independent Schmitt-Trigger GPIO channels • Any combination of input or output
DAQ IO modules: PWM Main features • Two PWM independent channels @3.11KHz • DC @ 1024 step resolution • Software controls start/stop signals
DAQ IO modules: USB Main features • Full-speed USB2 device • CDC USB Class • Benchmarked* USB speed is up to 4Mbit *According to Programmer’s Guide: MSP430 USB API Stack for CDC
MSP430F5529 Firmware Block Diagram (1) ADC (2) GPIO USB CDC PC Driver MSP430 Request Decoder LabView USB CDC MSP430 Driver (3) PWM
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
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
MSP430F5529 Firmware Block Diagram PWM request command structure PWM1 DC in steps PWM2 DC in steps Start/Stop PWM generator 1: Start PWM generator 0: Stop PWM generator 012807621 PWM1 DC: ( PWM1 DC: ( PWM Generator: Started
Instrument Panel Prepares A2D request command & transmits it Receives measured data from A2D & Converts it Reference GUI design block diagram Prepares 2 PWM requests & transmits them Reads data from port & converts it Prepares & transmits Data out to Port
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.
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.
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.
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.
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.
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 .
GUI block diagram description GPIO Read request & Data Converter Inputs: • GPIO In String – read from Port request. Outputs: • Boolean array – data from Port
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.
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.
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.
GUI block diagram description PWM control PWM transmit • Inputs: • 2 PWM duty cycle controls. • Boolean PWM On/Off control. • Outputs: • PWM Control String to micro controller via USB link.
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
Test Environment Conversion time measurement, delay = 0 cycles
Test Environment Conversion time measurement, delay = 100 cycles
PWM measurements Duty Cycle = 720/1024 = 70.3%
PWM measurements Duty Cycle = 320/1024 = 31.25%
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