DAQ
JRN
Posts: 3
I am using A BASIC Stamp HomeWork Board and I have a flexiforce op-amp circuit connected to an 0831CCN A/D converter.· Right now I am using the BASIC Stamp as a simple volt meter but what I want to do is use StampPlot to plot the change in voltage.· Does anyone have any suggestions.
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
-Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
StampPlot - GUI and Plotting, and XBee Wireless Adapters
Southern Illinois University Carbondale, Electronic Systems Technologies
-Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
StampPlot - GUI and Plotting, and XBee Wireless Adapters
Southern Illinois University Carbondale, Electronic Systems Technologies
'
[noparse][[/noparse] Title ]
' {$STAMP BS2}
' {$PBASIC 2.5}
'
[noparse][[/noparse] Declarations ]
adcBits VAR Byte
v VAR Byte
r VAR Byte
v2 VAR Byte
v3 VAR Byte
'
[noparse][[/noparse] Initialization ]
CS PIN 0
CLK PIN 1
DataOutput PIN 2
DEBUG CLS 'Start display.
'
[noparse][[/noparse] Main Routine ]
DO
GOSUB ADC_Data
GOSUB Calc_Volts
GOSUB Display
GOSUB Plot
LOOP
'
[noparse][[/noparse] Subroutines ]
ADC_Data:
HIGH CS
LOW CS
LOW CLK
PULSOUT CLK, 210
SHIFTIN DataOutput,CLK,MSBPOST,[noparse][[/noparse]adcBits\8]
RETURN
Calc_Volts:
v = 5 * adcBits / 255
r = 5 * adcBits // 255 '.. new line
v2 = 100 * R / 255
RETURN
Display:
DEBUG HOME
DEBUG "8-bit binary value: ", BIN8 adcBits
DEBUG CR, CR, "Decimal value: ", DEC3 adcBits
DEBUG CR, CR, "DVM Reading: "
DEBUG DEC1 v, ".", DEC2 v2, " Volts"
RETURN
Plot:
DEBUG SDEC v, ".", SDEC v2,CR
RETURN
Display:
DEBUG HOME
DEBUG "8-bit binary value: ", BIN8 adcBits
DEBUG CR, CR, "Decimal value: ", DEC3 adcBits
DEBUG CR, CR, "DVM Reading: "
DEBUG DEC1 v, ".", DEC2 v2, " Volts"
RETURN
On the plot, it should take this ok, don't see a problem with it.
Plot:
DEBUG SDEC v, ".", SDEC v2,CR
RETURN
You mention you are not getting a checksum error, as I would expect not since you are not sending binary values such as DEBUG V, but instead you are sending ASCII values using SDEC.· There is no checksum when using ASCII values.
I would start by taking out the DISPLAY routine, and just sending the plot data.· Once you have that plotting, you can add back in line by line the display code to see if one of those is causing issues.
I forgot to link earlier, but those tutorials can be found at the bottom of:
http://www.selmaware.com/stampplot/download.asp
-Martin
·
http://www.parallax.com/html_pages/downloads/software/software_plxdaq.asp
You can insert a chart/graph in the Excel worksheet linked to the columns/rows of data to view your data.