simulation help

HAZELEB

Member
Hi, How do I get this test program to run through the simulation? It waits at the serin for data entry but regardless of what is entered it ether pops up again or says try again – illegal serin data entry. Any help appreciated.

main:
serin 7,t2400,($55,$55),b0,b1
debug
test_ldr:
if b0 > 40 then ldr_high
ldr_low:
low 0
goto test_temp
ldr_high:
high 0
test_temp:
if b1 > 20 then temp_high
temp_low: low 1
goto main
temp_high:
high 1
goto main









Ted.
 
Last edited:

HAZELEB

Member
Hi, e thank you for the response I am new to using the simulator so do I need to set anything else in the simulator as it’s still not working for me it just pops up a new box asking for data input. Thanks

Ted.
 

eclectic

Moderator
Ted.
For the moment, just drag/move the Serin box, after you have input the values.

You'll see the output "lights" have changed.

Then the box will move back again!

No, I don't know why. Yet.

e.
 
Last edited:

HAZELEB

Member
Hi again, e your previous example now works I was using lower case instead of upper case many thanks for your help.

Ted.
ps. Can you explained how you choose which qualifiers to use and why they are needed thanks.
 
Last edited:

eclectic

Moderator
It's my Dingaling!

First, there are a lot of references on the forum to qualifiers,
which will explain in better detail.

But, here goes anyway.....

http://www.picaxe.orconhosting.net.nz/all3.jpg

shows a real working circuit.

Why “UUU” ? U = ASC85. (or $55 in your original post)
Binary 85 = 01010101 (Ding-a-ling several times).

In Stan S's link, the transmitter code is

serout 4, n300, (85,85,85,85, “ABC”, b1)

In simplified terms

Dingaling (“Wake up”)
“ABC” = “This message is for YOU”
b1 = the message's value.

The receiver then only “listens” to its own messages. (see 2nd and 3rd boxes)

You don't HAVE to have "ABC". "TED" would work as well.

Hope this helps.
E.
 

hippy

Ex-Staff (retired)
Ideally that "ABC", "TED" or whatever should be a sequence of binary bits which would give good resilience to / rejection of bit and timing errors. Something which would also reject the case where a data bit could act as a start bit and vice-versa is also desirable.

I don't know if anyone has ever sat down and worked out what a good sequence would be, you can tell I haven't. $AA and $55 would give good bit synch checking but could be prone to bit-sliding synch errors where start bit / data bit confusion creeps in.

$AA or $55 is also commonly used as the preamble to pre-condition the RF reciever so not a good choice in the qualifiers. That leads to suggesting $33 / $C3 / $CC but that's not so good for accurate bit checking. Perhaps $33 / $CC are acceptable as the preamble, or $CC,$AA,$CC,$AA or similar.

There should be an optimal choice for qualifiers which maybe someone will find some time to determine.
 
Top