Hi Guys,
I was just after some pointers with regards to communications over a serial link and wondered if the following would be suffice for a wired or wireless setup?
the main code has yet to be written I am more interested in the data link first any advice on improving things is much appreciated.
The modules I want to create are all 14m2 Masters talking to a single Picaxe 28x2 slave receiver that is displaying the data that they are transmitting, its just I don't want the receiver to miss anything.
Rich
b.2=busy line
b.0=serial out
b.1=serial in
c.0=switch input for test
main:
low b.2
if pinc.0=1 then let b10="A" let b17="Z" reverse b.2 goto serialtx
endif
goto main
serialtx:
if pinb.2=1 then serialtx
high b.2
let b19=b19+1
if b19=6 then let b19=0 let bit0=1 let b18=0 goto main
endif
serout b.0,t19200_32,("UUUUUTEST",b10,b11,b12,b13,b14,b15,b16,b17)
ack:
let bit0=0
let b18=b18+1
if b18=10 then let b18=0 goto serialtx
endif
serin [200,ack], b.1,t19200_32,("TESTACK") 'rec
let bit0=1
goto main
I was just after some pointers with regards to communications over a serial link and wondered if the following would be suffice for a wired or wireless setup?
the main code has yet to be written I am more interested in the data link first any advice on improving things is much appreciated.
The modules I want to create are all 14m2 Masters talking to a single Picaxe 28x2 slave receiver that is displaying the data that they are transmitting, its just I don't want the receiver to miss anything.
Rich
b.2=busy line
b.0=serial out
b.1=serial in
c.0=switch input for test
main:
low b.2
if pinc.0=1 then let b10="A" let b17="Z" reverse b.2 goto serialtx
endif
goto main
serialtx:
if pinb.2=1 then serialtx
high b.2
let b19=b19+1
if b19=6 then let b19=0 let bit0=1 let b18=0 goto main
endif
serout b.0,t19200_32,("UUUUUTEST",b10,b11,b12,b13,b14,b15,b16,b17)
ack:
let bit0=0
let b18=b18+1
if b18=10 then let b18=0 goto serialtx
endif
serin [200,ack], b.1,t19200_32,("TESTACK") 'rec
let bit0=1
goto main