28X-1 output problem

radcom

Member
I have a picaxe 28X-1 and it should recive a value sent to it over the programming pin and then set the output pins accordingly, my code works perfectly well on the simulator, but when I download the code to the 28X-1 the outputs 4&5 come on and when they shouldn't and I can't work out why
Code:
main:
	pause 5000
	let b0 = 0
	setfreq m8
go:	
	serrxd b0
	let pins = b0
	goto go
________
Easy Vape Vaporizer
 
Last edited:

Dippy

Moderator
Where is the data byte coming from?
Have you tried debugging/Sertxding to confirm the data byte is what you expect?
 

radcom

Member
Yes I have and the data sent is appears to be correct
the data sent in needs to be at 9600 baud which I forgot to mention
 
Last edited by a moderator:

hippy

Ex-Staff (retired)
And exactly how are you sending them ?

If you're typing these in through the Programming Editor text entry and hitting send, you're sending ASCII characters. For "0", that's a value of $30 ... coincidentally bits 4 and 5 set, exactly what you're seeing.
 

radcom

Member
i'm using the terminal in the programming editor
if that is the problem how is it corrected i've tryed puting # in front of the b0 so it is like this: serrxd #b0 but this doesn't work and nothing happens
 
Last edited by a moderator:

hippy

Ex-Staff (retired)
That should work but you have to send something at the end of the number to let the PICAXE know it's had the complete number; a carriage return, comma or space or something similar.
 
Top