Stamp Plot and BS1
koca
Posts: 4
I'm trying to use the Stamp Plot program (tried Lite and Pro) with my BS1 module. It is connected through the BS1-> serial adapter and the serial->USB adaptor, both from Parallax. The stuff works fine with the Stamp Editor, but it does not work with the StampPlot programs. I am following the programs and instructions in the Industrial Control text. Both programs connect to the stamp, but none plot. The Pro version gives me a "framing error, Discarding data" when it connects to the Stamp. I set the BAUD rates to 2400, so I do not know what could be going wrong and even tried the rest to know avail.
Any ideas?
Thanks!
Any ideas?
Thanks!
Comments
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap used 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
SX-Video Display Modules www.sxvm.com
Coming soon! Propeller based OSD module www.hittconsulting.com
·
The problem isn’t baud rate…It’s probably data…Are you using the DEBUG command to send the data from the BS1? The BS1 does not output standard data the way a BS2 does. Instead it sends out an entire packet of all register data which the BASIC Stamp Editor decodes to give you the information you need. In an external application that may not be what you’re looking for. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Here is the code I am using. It is pretty much copied from the IC control book with some modifications so that it will work on the BS1.
PAUSE 500
DEBUG "!RSET",CR ' Reset plot to clear data
DEBUG "!TITL HEATER CONTROL SAMPLE",CR 'Caption form
DEBUG "!PNTS 6000",CR ' 6000 sample data points
DEBUG "!TMAX 600",CR ' Max 600 seconds
DEBUG "!SPAN 700,1200",CR ' 70-120 degrees
DEBUG "!AMUL .1",CR ' Multiply daty .1
DEBUG "!DELD",CR ' Delete Data File
DEBUG "!SAVD ON",CR ' Save Data
DEBUG "!TSMP ON",CR ' Time Stamp On
DEBUG "!CLMM",CR ' Clear Min/Max
DEBUG "!CLRM",CR ' Clear Messages
DEBUG "!PLOT ON",CR 'Start Plotting
DEBUG "!RSET",CR ' Reset plot to time 0
' Define constants & variables
SYMBOL CS = 3 ' 0831 chip select active low
SYMBOL CLK = 4 ' Clock pulse
SYMBOL Dout = PIN5 ' Serial data output from 0831
SYMBOL Datain =B0 ' Variable to hold incoming number (0 to 255)
SYMBOL Temp =W1 ' Hold the converted value representing temp
SYMBOL TempSpan = 5000 ' Full Scale input span in tenths of degrees.
'TempSpan = 5000 ' Declare span. Set Vref to .50V and
' 0 to 255 res. will be spread over 50
' (hundredths).
SYMBOL Offset = 700 ' Minimum temp. @Offset, ADC = 0
SYMBOL Duty = W2
Duty = 100
LOW 6
Main:
PAUSE 500
GOSUB Getdata
GOSUB Calc_Temp
GOSUB Control
GOSUB Display
GOTO Main
Getdata: ' Acquire conversion from 0831
LOW CS ' Select the chip
LOW CLK ' Ready the clock line.
PULSOUT CLK,1 ' Send a clock pulse to the 0831
SYMBOL Count = B1 'Counter variable
FOR Count = 1 TO 8
Datain = Datain * 2 + Dout 'Shift grab next data bit and shift left
PULSOUT CLK,1 'Postclock the data
NEXT Count
HIGH CS ' Stop conversion
RETURN
Calc_Temp:
Temp = TempSpan/255 * Datain/10 + Offset
RETURN
Control:
PWM 6,Duty,200 ' PWM
RETURN
Display:
DEBUG #Temp,CR
RETURN
Mike is right, which is what I was getting at above…Unlike the BS2 the BS1 does not send out exactly what you think. The Editor does some translation at compile time to handle this, but Stamp Plot cannot. You will need to use the SEROUT command instead and use a normal I/O pin with an driver (such as the MAX232) to get the data into Stamp Plot. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Also I just noticed that on this page it says there is a selector for either the BS1 or BS2:
http://www.parallax.com/html_pages/downloads/software/stamp_plot_pro_info.asp
The screenshot and text does not match up with the program available for download , ie. it does not have the selector. Any idea which version has this selector option?
No, PCI/PCO are the programming ports…You would have to use a standard I/O pin, (PIN0 through PIN7) to SEROUT the data and use the driver (MAX232). As for the selector, I wasn’t aware there was one. Perhaps Martin Hebel will chime in and answer this one? Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Yes, the downloads page has the images slightly mixed up.· That's actually StampPlot Lite, but the BS1 selector apparently won't help.
Never having worked with the BS1, I didn't know there were all these issues involved with sending debug data back.· I was just told it was 2400 baud.· Sorry for the false advertising, but I learned something here!
-Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
StampPlot - GUI and Plotting, and XBee Wireless Adapters
Southern Illinois University Carbondale, Electronic Systems Technologies