stamp plot lite

I have a 08m with a led blinking once per second. I would like to plot it in stamp plot lite. I have the serial lead in place,but it doesn't work. I have read that I should use debug/serout/sertxd. This is my simple programme,

main:
high 0
pause 1000
low 0
pause 1000
debug
goto main
Can anyone tell me what I am doing wrong?

David Miles.
 

Technical

Technical Support
Staff member
You cant use debug like this easily so replace

debug

with

sertxd (#b0)
let b0 = b0 + 1

then make sure the logging software is running at 4800,n,8,1

Also don't use high and lows on output 0 - use a different pin. This is because the highs and lows will corrupt the serial data - output 0 is also shared as the serial transmit pin.


Edited by - Technical on 20/07/2006 13:58:59
 

xstamp

Senior Member
I hope the following codes (that sends commands to set up StampPlot Pro, followed by three channels of ADC data from a PICAXE -18X) will help to show the serial output format required. You will of course need to ‘connect’ StamPlot before running the PICAXE programme, in order to receive the setup commands.



serout 7,N1200,("!RSET",cr)
serout 7,N1200,("!TMAX 60",cr)
serout 7,N1200,("!SPAN 0,1000",cr)
serout 7,N1200,("!SHFT ON",cr)
serout 7,N1200,("!FLSH ON",cr)
serout 7,N1200,("!NUMB 3",cr)


pause 1000
start:
readadc10 1, w0
readadc10 2, w1
readadc10 4, w2
serout 7,N1200, (#w0,",",#w1,",",#w2,",",CR)
pause 10
goto start


 

xstamp

Senior Member
Thought of a couple more issues. If you are sending binary data, rather than ASCII, you do not need to have a CR after the adc readings. Also, I forgot that you are using a PICAXE-08M and have therefore included example code below. The setup commands place StampPlot Pro in binary mode with a checksum that rejects transmission errors.

Note that StampPlot Pro can also be downloaded free for home and educational use. Therefore, no real reason to use the single channel StampPlot Lite version.



'Three PICAXE 08M ADC values in binary StampPlot compatible format.
'From Output 0 at 1200 baud

pause 1000
serout 0,N1200,("!RSET",cr)
serout 0,N1200,("!TMAX 60",cr)
serout 0,N1200,("!SPAN 0,256",cr)
serout 0,N1200,("!SHFT ON",cr)
serout 0,N1200,("!FLSH ON",cr)
serout 0,N1200,("!NUMB 3",cr)
serout 0,N1200,("!CSUM ON",cr)
serout 0,N1200,("!USEB ON",cr)

pause 1000

start:
readadc 1, b0
readadc 2, b1
readadc 4, b2
b3 = b0 + b1 + b2
serout 0,N1200, (b0,b1,b2,b3)
goto start

Please let me know if you have any problems moding the code for fewer channels, different sample or transmission rates.

 

manuka

Senior Member
Give Parallax's <A href='http://www.parallax.com/html_pages/downloads/software/software_stampDAQ.asp ' Target=_Blank>External Web Link</a> StampDaq (free) a whirl perhaps, as some consider it superior.
 

xstamp

Senior Member
Thanks for the link MANUKA, but StampDaq is 'only' an add-in for Excel (I know its hard to believe but not everyone has MS Office) and StampPlot is a really free standalone application. All you need is a PICAXE and StamPlot Pro to produce a virtual multi -channel strip chart recorder that plots analog and digital inputs at up to 9.6Kbaud.



 
Thanks, xstamp, manuka, and technical for all your help. I will get Stamp Plot Pro ( didn't know it was free! ) and give it a try.

David Miles.
 
Hi Xstamp.
I downloaded Stamp Plot Pro and tried this:-
'Three PICAXE 08M ADC values in binary StampPlot compatible format.
'From Output 0 at 1200 baud

pause 1000

serout 0,N1200,(&quot;!RSET&quot;,cr)
serout 0,N1200,(&quot;!TMAX 60&quot;,cr)
serout 0,N1200,(&quot;!SPAN 0,256&quot;,cr)
serout 0,N1200,(&quot;!SHFT ON&quot;,cr)
serout 0,N1200,(&quot;!FLSH ON&quot;,cr)
serout 0,N1200,(&quot;!NUMB 3&quot;,cr)
serout 0,N1200,(&quot;!CSUM ON&quot;,cr)
serout 0,N1200,(&quot;!USEB ON&quot;,cr)
pause 1000

start:

readadc 1, b0
readadc 2, b1
readadc 4, b2
b3 = b0 + b1 + b2
serout 0,N1200, (b0,b1,b2,b3)
goto start

It almost worked, but gave a scrolling &quot;framing error&quot; message in the debug window

Any ideas?

I do have an 18X Datalogger module ( AXE110 ), if you have a simple programme suitable for it that I could cut and paste, perhaps I could at least get the Stampplot pro going to try out.

David Miles.
 

xstamp

Senior Member
Hi Dave,

Assuming that you have already setup the StampPlot commuication window for 1200 baud etc, make sure that you click on the 'connect' button before switching on the PICAXE. Otherwise StampPlot will receive the binary data without being told not to expect ASCII. When receiving binary it also needs to know the number of bytes and if checksum is included. I have asked the PICAXE to transmit this setup stuff before starting to read the ADC.

To make things simple you could edit out all the setup commands (they start with !)and just entre them manually to StampPlot whilst receiving only ADC serial data.

Let me know if your still having problems after trying the above suggestions.


 
Hi Xstamp.
I set the baud rate at 1200 (was 4800!) and then tried:-

'Three PICAXE 08M ADC values in binary StampPlot compatible format.
'From Output 0 at 1200 baud
pause 1000
serout 0,N1200,
serout 0,N1200,
serout 0,N1200,
serout 0,N1200,
serout 0,N1200,
serout 0,N1200,
serout 0,N1200,
serout 0,N1200,
pause 1000

start:
readadc 1, b0
readadc 2, b1
readadc 4, b2
b3 = b0 + b1 + b2
serout 0,N1200, (b0,b1,b2,b3)
goto start
But Programming Editor would not run it.

Any more ideas?

David Miles.
 

xstamp

Senior Member
Sorry your still having problems. I think they maybe mainly to do with learning how to drive StampPlot. The listing below should help by dropping the need for adc inputs and generating known data (three ASCII ramps) continously over the standard PC cable. You will need to use the pulldown communication menu to set the baud rate to 4.8K baud, then click on the 'connect' button before running the following PICAXE code.

'Output three ramps from PICAXE 08M in StampPlot compatible ASCII format.


sertxd (&quot;!RSET&quot;,cr)
sertxd (&quot;!TMAX 60&quot;,cr)
sertxd (&quot;!SPAN 0,1000&quot;,cr)
sertxd (&quot;!SHFT ON&quot;,cr)
sertxd (&quot;!FLSH ON&quot;,cr)

start:
for w0 = 0 to 499
w1 = w0/2
w2 = w0*2
sertxd (#w1,&quot;,&quot;,#w0,&quot;,&quot;,#w2,&quot;,&quot;,cr)
pause 500
next
goto start
 
Hi Xstamp.

Got a plot at last! Thank you and everyone else who helped.You were right about me not being used to using Stamp Plot. I had to configure your last piece of code:-
'Output three ramps from PICAXE 08M in StampPlot compatible ASCII format.


sertxd (&quot;!RSET&quot;,cr)
sertxd (&quot;!TMAX 60&quot;,cr)
sertxd (&quot;!SPAN 0,1000&quot;,cr)
sertxd (&quot;!SHFT ON&quot;,cr)
sertxd (&quot;!FLSH ON&quot;,cr)

start:
for w0 = 0 to 499
w1 = w0/2
w2 = w0*2
sertxd (#w1,&quot;,&quot;,#w0,&quot;,&quot;,#w2,&quot;,&quot;,cr)
pause 500
next
goto start
for ASCII data.
And this:-

main:
high 2
pause 1000
low 2
pause 1000
sertxd (#b0)
let b2 = b2 + 1
goto main

for Binary Data. I have no idea why thay should be different, but the important thing is that I managed to get it to work, and can now get on with what I want to do. Thanks.

David.
 
Top