strange output using sertxd on an 08-m

satanx

New Member
hello all
i am using an 08-m as a simple temp/fan controller, and i'm getting garbled outputs from the terminal.
i set up my own programmer(2 r's and a serial cable) which has worked fine in my other picaxe projects so far, i set up the r's on the board so it's a simple connection to the serial cable to program. this board was originally something else, and nothing to do with the programming end of it has changed since then.i have checked all my wiring carefully and the code simulates fine.
port 1 is a temp sensor ( ds18b20 )
port 2 is a temp sensor (ds18b20 )
port 4 goes to a uln2803
serial in/out and gnd pins are hardwired for that purpose( as i don't need them for anything else ).
Code:
rem temp stuff 1.0



start:
	low 4			rem turn fan off
	goto run

run:
	wait 1 		rem wait 1 secs
	readtemp 1,b1  rem read ceiling temp
	readtemp 2,b2  rem read house temp

				rem debug 

	sertxd("ceiling temp = ",#b1)
	sertxd("house temp = ",#b2)
	sertxd("fan state = ",#b4)
	let b1 = b1 + 3

				rem nasty maths

	if b1 > b2 and b2 < 21 then fanon      rem check temps
	goto fanoff

fanon:
	high 4		rem turn fan on
	goto run

fanoff:
	low 4			rem turn fan off
	goto run
this is the second iteration of the code, the last one had some ascii chars ("temp house =" kind of stuff) and didn't adjust b1 by 3 deg c.

the terminal shows random garbled strings of text, both text and symbols. it's outputting what seems to be a reasonable string length each cycle, about 42 chars, but is totally meaningless. also there is no intermediate data, only when sent from the picaxe(there is a 1 second pause between data chunks).the debug function used instead of the sertxd function will work only once, and then does not refresh.
i have the latest version of the programming editor, and am using vista on a modern machine through the serial port.

both cables to the temp sensors are less than 2m long( it says 70m wire lengths are supportable).

i've done a forum search and nothing seems to fit, i used to work in digital electronics and so my grounds vary from impressive to bulletproof(dodgy grounds cost us way to much grey hair in digital circuits).

can anyone offer any ideas? i'm all out.

richard
 

Grant Fleming

Senior Member
Hi Richard

Start simple - break it down.

What baud are you using on the terminal and PICAXE? It should match.

Write a small test looping programme just with sertxd and pauses.

Once you get going you can use a cr,lf at the end of each sertxd.

GJF
 

eclectic

Moderator
Richard.
A quick first thought.

Input pin 3. Is it floating?
If so, tie to ground with say 10k.

e

Added.
Perhaps then try a 10ms pause between each Sertxd statement
 
Last edited:

satanx

New Member
Hmmm some food for thought - i'll try those things and let you all know :)

i have drawn out the circuit diagram if anyones interested, after this is behaving i'll change it for an 18x or 28x and do an entire house :)

thanks for your help guys :)

the diagram's a bit rough, but it's basically accurate.
 

Attachments

Last edited:

satanx

New Member
well tied port 3 to ground with a 10k r, and tried adding pauses of 50ms. still giving garbage.
baud is set to 4800,n,8,1 on both picaxe and pc.
but what i get is like the garbled output from eclectic's post.
tried the test sertxd prog from the manual and it works fine, readable output.
so i'm guessing it's code, the picaxe works as it's supposed to it just doesn't output to the pc.
???
 

hippy

Ex-Staff (retired)
Not sure how your Download connector ends up being on your board but the diagram doesn't match how a normal 3-pin molex header would be wired. Normally serial from the PC goes to the centre pin then to Serial In via the 10K/22K, Serial Out and 0V are on the outer two pins.

How a keyed 3-pin molex looks when viewed from the top looking down on a pcb ...

Code:
                      .------.
Serial out to PC      |  O  _|
                      |    | |
Serial in from PC     |  O | |
                      |    |_|
Common 0V             |  O   |
                      `------'
 
Last edited:

eclectic

Moderator
well tied port 3 to ground with a 10k r, and tried adding pauses of 50ms. still giving garbage.
baud is set to 4800,n,8,1 on both picaxe and pc.
but what i get is like the garbled output from eclectic's post.
tried the test sertxd prog from the manual and it works fine, readable output.
so i'm guessing it's code, the picaxe works as it's supposed to it just doesn't output to the pc.
???
I built a circuit from 08M / 2x DS18B20 / and LED instead of ULN2803

The terminal output in my first post was directly from your code, using different baud rates.

I've just rebuilt the circuit and used your original post #1 code.
It outputs legibly. See screen-dump.

e
 

Attachments

satanx

New Member
hmmm well tomorrow i'm going to desolder this 08 and try it out in a protoboard rig, and see if i get the same issues.

hopefully it's just something silly i'm overlooking, i'll soon find out.

technical, i've tried it both with and without the debug code, same thing happens.originally i was using sertxd and cr for a neat output, though i've tried several different things.

thanks for your time everyone, it's great to be part of an active electronics community :)
 

Peter-C

Member
garbled output with sertxd on 8M

I came across your post when I had the same problem. I eventually spotted a stray 'high 0' in my code, which I was porting from an 18A.
Might be worth trying inserting a 'low 0' command at the start of the prog to make sure that wasn't the problem? It gave me similar symptoms and removing it instantly solved the issue.
If not, it might help somebody else in the future! :)
 
Top