background image

○ 12: 1,000,000 - only valid when a single channel is enabled 

● type: trigger type - string with following values 

○ 'auto' 
○ 'normal' 

● edge: trigger edge - string with the following values 

○ 'rising' 
○ 'falling' 

● level: trigger level - numeric 12 bit value with a valid range of 0 to 4095. This corresponds to -12V to + 

12V. Use the following equation to convert from volts to a numeric level: 

○ 2048 • (1 + Vtrigger / 12) 

The oscilloscope mode functions are: 

● startOSC(addr) - enable oscilloscope mode on selected DAQC2plate 
● stopOSC(addr) - disable oscilloscope mode on selected DAQC2plate 
● setOSCchannel(addr, C1, C2) - select which channels to sample 
● setOSCsweep(addr,rate) - select sample rate used during sweep 
● getOSCtraces(addr) - download the sampled data from the DAQCplate 
● setOSCtrigger(addr,channel,type,edge,level) - setup the trigger for the sweep. 
● trigOSCnow(addr) - do immediate trigger of oscilloscope. This is typically used when no trigger occurs 

for a predetermined amount of time. 

● runOSC(addr) - start a sweep sequence 
● DAQC2.getOSCtraces(addr) - fetch the captured oscilloscope data from the DAQC2plate. This will 

12-bit integer values located in two lists: trace1 and trace2. 

Assuming a DAQC2plate set to address 0, the basic sequence of steps to generate a single trace on channel 1 
looks like: 
 

import piplates.DAQC2plate as DAQC2 
 
DAQC2.startOSC(0)           #enable oscope 
DAQC2.setOSCchannel(0,1,0)  #use channel 1 
 
## Set up trigger: 
##    Use channel 1 
##    Normal trigger mode (don't collect data until trigger conditions are met) 
##    Trigger on rising edge of waveform 
##    Trigger at 0.0 volts 
DAQC2.setOSCtrigger(0,1,'normal','rising',2048) 
 
## setup sample rate for 10,000 samples per second 
DAQC2.setOSCsweep(0,6) 
DAQC2.intEnable(0)          #enable interrupts 
DAQC2.runOSC(0)             #start oscope 
 
## Wait for sweep to complete by monitoring Ocsope interrupt flag 
dataReady=0 
while(dataReady==0): 
    if(DAQC2.GPIO.input(22)==0): 
        dataReady=1 
        DAQC2.getINTflags(0) #clear interrupt flags 

Summary of Contents for DAQC2plate

Page 1: ...DAQC2plate Reference Guide Version 1 04 ...

Page 2: ... 12 Using a Potentiometer to Generate a Variable Voltage 12 Measure Temperature Using an LM35 Sensor 13 Digital Inputs DIN 13 Connector 13 Specifications 13 Functions 14 Example Monitor an External Button 14 Extended Functions 15 Connector 15 Analog Outputs DAC 15 Specifications 15 Functions 16 Auxiliary Power Supply 16 PWM 16 Specifications 16 Functions 16 Example Speed Control of a DC Motor 17 F...

Page 3: ... Input 20 Special Modes 20 Installing the Applications 20 Motor Controller 22 Connections 22 Commands 24 Function Generator 25 Specifications 25 Connections 25 Commands 26 Oscilloscope 26 Specifications 27 Connections 27 Commands 27 ...

Page 4: ...nals on DAC outputs 1 and 2 Stepper Motor Controller in this mode the DAQC2plate can independently drive two unipolar stepper motors using the DOUT connectors Oscilloscope in this mode the the DAQC2plate can be used as a two channel oscilloscope with a sample rate of 1 million samples second Analog inputs 0 and 4 are used in this mode Although the examples below have been written for Python 2 7 th...

Page 5: ...enience the name of each terminal is printed on the bottom of the board If you are familiar with the original DAQCplate note that Digital Inputs Header and the Analog Inputs Header have been swapped This was done to provide better signal to noise performance on the analog inputs ...

Page 6: ...digital output connector provides eight open drain outputs a 5VDC output for driving loads and a flyback protection terminal for inductive loads Use these outputs to drive LED strings DC motors relays solenoids buzzers unipolar stepper motors resistive heating elements ultrasonic rangefinders and incandescent automotive light bulbs Each digital output also has a green LED connected to it Whenever ...

Page 7: ...your Pi Plates 100mA for each DAQC2plate with all LEDs on and any components you connect to a DOUT terminal To generate a simple digital signal output connect a 4 7K resistor between 5VDC and the DOUT pin you wish to use Note that the output will be inverted i e setting the pin will make the output zero volts while clearing it will make it 5VDC Functions addr must be in the range of 0 through 7 bi...

Page 8: ...D circuit Connect the anode of the LED the long wire to one end of a 220 ohm resistor Route a red wire from the other side of the resistor to the 5VDC terminal on the DAQC2plate digital output terminal block Route a black wire from the cathode of the LED to Output 0 of the ...

Page 9: ...D A Short String of White LEDs Control some under counter lighting with this circuit Connect three high bright white LEDs in series as shown and then attach a 12VDC power supply with a center positive connector Then put a 100 ohm resistor between the LEDs and the power supply Attach the cathode of the rightmost LED to DOUT0 of the terminal block pin ...

Page 10: ...board is at address 0 type DAQC2 setDOUTbit 0 0 to turn the LED string on Type DAQC2 clrDOUTbit 0 0 to turn off the LED string Driving an Inductive Load 1 Use a simple breadboard to build up this 5V solenoid circuit 2 Connect the red wire from the solenoid to a pair of red wires that route from the breadboard ...

Page 11: ...m at the top of this page as well as the one below to locate the Analog Input terminals Specifications Eight inputs 16 bit resolution 16 bits is obtained by averaging 128 fourteen bit values 366μV per bit Maximum input voltage range 12 volts 0 1 precision SNR of 75dB with a 10VDC input voltage All inputs have ESD protection All inputs have over and undervoltage protection Bandwidth of each input i...

Page 12: ... ground terminal on the Analog Input Block terminal 9 4 Route the yellow wire to Analog Input 0 on the Analog Input Block terminal 1 5 Go into the Python interactive environment and import the DAQC2plate module by typing import piplates DAQC2plate as DAQC2 6 Assuming a DAQC2plate board address of 0 type DAQC2 getADC 0 0 from the command prompt and look at the returned value 7 Rotate the pot and re...

Page 13: ...that is proportional to the temperature in degrees Celsius 10mV 1 degree C If you are performing this experiment inside then the DAQC2plate measurement should return a value of about 250mV for a temperature of 25C 7 For more information about the LM35 go here Digital Inputs DIN Use the digital inputs to detect simple on off devices such as buttons rotary encoders and the output of another microcon...

Page 14: ... push button to a protoboard as shown below 2 Route the yellow wire to Digital Input 0 on the Digital Input Block terminal 1 3 Route the black wire to a ground terminal on the Digital Input Block terminal 9 or 10 4 Go into the Python interactive environment and import the DAQC2plate module by typing import piplates DAQC2plate as DAQC2 5 Assuming a DAQC2plate board address of 0 type DAQC2 getDINbit...

Page 15: ...ir of connectors 3 A frequency counter this protected input will measure the frequency of any digital signal 4 Two PWM outputs these 10 bit resolution PWMs output a 5V digital waveform and can be set from 0 to 100 Very useful for DC motor and fan speed control Connector Refer to the diagram at the top of this page as well as the one below to locate the terminals for each of the Extended Functions ...

Page 16: ... or DAQCplate in your stack only one can be used for providing Auxiliary Power By design accidentally hooking up multiple supplies on multiple DAQCplate boards should not cause any damage but only one of the supplies will be providing current Usage 1 Power down your stack and unplug the power supply currently attached to your Raspberry Pi 2 Referring to the image below loosen the screws on termina...

Page 17: ... and pulls less than 1 Amp 1 Attach the motor a 1K resistor a PN2222 NPN transistor and the wiring to the protoboard as shown in the diagram above 2 Route the red wire to the 5VDC terminal pin 10 on the Digital Output Block 3 Route the black wire to a ground terminal on the Extended Functions block terminal 4 or 5 ...

Page 18: ...put Range ground referenced signal can range from 3 3 to 5VDC Measurable Frequency Range 1 00 to 150Khz Accuracy 2 Input Hysteresis 1 3V Functions getFREQ addr returns the frequency of the attached signal as an integer value RGB LED Each DAQC2plate has a general purpose RGB LED At power up this LED is set to white to indicate a successful hardware initialization However you can use the LED functio...

Page 19: ...ow DIN2 set when a transition occurs on DIN2 that set by the enableDINint function described below DIN3 set when a transition occurs on DIN3 that set by the enableDINint function described below DIN4 set when a transition occurs on DIN4 that set by the enableDINint function described below DIN5 set when a transition occurs on DIN5 that set by the enableDINint function described below DIN6 set when...

Page 20: ...odes To install them open a terminal window inside your home directory and perform the following steps 1 If you haven t already done so sudo pip install Pi Plates 2 If you haven t already done so sudo pip3 install Pi Plates 3 Install the Python QT routines sudo apt get install python3 pyqt4 4 Download the apps and the documentation sudo wget https pi plates com downloads DAQC2apps tar gz 5 Expand ...

Page 21: ... manual explaining all of the controls and functions of the program Below we will explain the functions behind each mode and how they are used Keep in mind that the functions provided by these modes are not meant to replace bench top test equipment Also note that using legacy ...

Page 22: ... drivers make an ideal dual unipolar stepper motor controller When used in this mode the pinout mapping changes to It is beyond the scope of this document to explain the theory operation of unipolar stepper motors so we suggest you learn more about them here Connections The picture below shows how to connect two 12VDC stepper motors to the DOUT header In this case an external supply is used and is...

Page 23: ... power supply input to drive them In this case and external 5VDC power supply is attached to terminals 6 and 7 of the Extended Functions connector When connected in this manner a power supply is not required for the Raspberry Pi The power terminals for the motors attach to the flyback protection input which ...

Page 24: ...n be 1 or 2 steps the number of desired steps when a MOVE command is issued must be in the range of 16383 and 16383 dir the direction of rotation when the JOG command is issued This is a string argument and the valid values are CW and CCW for clockwise and counter clockwise rate the step rate of the motor in steps per second Range of values is from 1 to 500 stepsize the motor controller supports w...

Page 25: ...e coils Also turns off the coils of a STOPped motor Function Generator In the Function Generator mode two of the 12 bit DAC outputs are updated 200 000 times a second to produce common waveforms such as Sine Square Triangle Sawtooth Inverted Sawtooth Noise Sinc All signals are ground referenced with a maximum amplitude of 4 095 volts 1 5 Specifications Range 10 to 10 000Hz Frequency Accuracy 1 typ...

Page 26: ...ble generated 6 noise computed 24 bit pseudo random output updated at 200Khz 7 sinc the classic sin x x function generated with lookup table level the two function generator outputs can be attenuated using the following level values 4 Full amplitude 3 1 2 amplitude 2 1 4 amplitude 1 1 8 amplitude The list of commands is shown below fgON addr chan enable function generator on selected channel Note ...

Page 27: ...bits Trigger Jitter 2μsec max Connections Use Analog Input terminal 1 for Oscilloscope Channel 1 and terminal 5 for Channel 2 Ground both signals using terminal 9 Commands The arguments used in the Oscilloscope commands are addr the address of the DAQC2plate board being addressed This can be 0 7 and is set via the address selection header described above C1 input channel 1 enable This can take on ...

Page 28: ...igger of oscilloscope This is typically used when no trigger occurs for a predetermined amount of time runOSC addr start a sweep sequence DAQC2 getOSCtraces addr fetch the captured oscilloscope data from the DAQC2plate This will 12 bit integer values located in two lists trace1 and trace2 Assuming a DAQC2plate set to address 0 the basic sequence of steps to generate a single trace on channel 1 loo...

Page 29: ...fundamentals For a real oscilloscope you need to visualize the data For that we recommend downloading our DAQC2plate application package You can find the instructions for this at the beginning of the Special Modes section on this page Once done open the folder in your home directory called Applications There you will see all of the python application programs including QTscope py The QT prefix ind...

Reviews: