Hi all,
I've spent the last two evenings trying to get an 08 to talk to a 20x2 via a serial out/in link but without success.
I've managed to get the 08 to talk to another 08 but when the transmitting 08 is connected to the reciving 20 nothing happens, so I assume that error is in the coding of the 20 as the pre serin code works fine.
code for the 08 is as follows..
and the code for the receiving 20 is....
The 20 is setting up three 8bit shift registers hence the three lines of 1's and 0's
The picaxe x2 product briefing states that the pin should be refered to as
the port number, in this case port c.2
I've tried changing the baudrate thinking that perhaps the 08 runs at 4mhz and the 20 runs at 8mhz so I've played around with those settings as well.
I'm obviously missing something so simple, please put me out of my misery
I've spent the last two evenings trying to get an 08 to talk to a 20x2 via a serial out/in link but without success.
I've managed to get the 08 to talk to another 08 but when the transmitting 08 is connected to the reciving 20 nothing happens, so I assume that error is in the coding of the 20 as the pre serin code works fine.
code for the 08 is as follows..
Code:
;1ST 08 TRANSMITTING
start:
b0=1
serout 0,n1200_8, ("uuuuuuuuuu") ;sends a waky waky call @ slow rate
pause 10 ;waits for the receiver to wake up
serout 0,n1200_8, ("ABC",b0) ;sends password ABC then b0
pause 1000 ;wait 1 second
b0=2
serout 0,n1200_8, ("uuuuuuuuuu") ;sends a waky waky call @ slow rate
pause 10 ;waits for the receiver to wake up
serout 0,n1200_8, ("ABC",b0) ;sends password ABC then b0
pause 1000 ;wait 1 second
goto start ;return to s
Code:
prestart:
b1 = %11111111 :gosub doit
b1 = %11111111 :gosub doit
b1 = %11111111 :gosub doit
pulsout c.4,10
pause 2000
b1 = %00000000 :gosub doit
b1 = %00000000 :gosub doit
b1 = %00000000 :gosub doit
pulsout c.4,10
start:
serin c.2, n1200_8,("ABC"),b0
if b0=1 then goto sig1
if b2=2 then goto sig2
goto start
sig1:
b1 = %00100100 :gosub doit
b1 = %10010010 :gosub doit
b1 = %01001001 :gosub doit
pulsout c.4,10
goto start
sig2:
b1 = %00100100 :gosub doit
b1 = %10010010 :gosub doit
b1 = %01100100 :gosub doit
pulsout c.4,10
goto start
doit:
for b0= 1 to 8
if b1 > 127 then high c.7 else low c.7
endif
pulsout c.5,10
b1 = b1 *2
next b0
return
The picaxe x2 product briefing states that the pin should be refered to as
the port number, in this case port c.2
I've tried changing the baudrate thinking that perhaps the 08 runs at 4mhz and the 20 runs at 8mhz so I've played around with those settings as well.
I'm obviously missing something so simple, please put me out of my misery