JayAuckland
New Member
I'm intending to eventually use a 14M2 chip to poll several switches (and possibly a potentiometer) and output a qualifier and value to show when each switch is pressed or not, sending the data down a serial line to several 'receiver' 14M2 chips.
For the moment I'm getting my head around it by breadboarding it using an 08M2 chip to poll the switches and this code:
I'm feeding the serial out data currently to just two chips, an 08M2 and a 14M2 (the only 14M2 I have at the moment) but i intend using all 14M2 chips when i build this up.
The 08m2 'receiver' chip and code works fine, inputting the serial data and responding to switch 3 by flashing an led.
However, the 14M2 chip is not responding, either when I try to get it to input one of the other switches' status or even when I 'parallel' it by setting it to input switch 3 - which the 08M2 responds to just fine.
14M2 'receiver' code:
I guess I'm somehow getting tangled up around the serin and serrxd syntax stuff or maybe the 08M2 and 14M2 chips operate in slightly different ways?
Help!!!
For the moment I'm getting my head around it by breadboarding it using an 08M2 chip to poll the switches and this code:
Code:
setfreq m4
Input c.2
Pollsw4:
If pinc.4 = 1 then
serout C.1,N4800_8,("SW4",1)
goto pollsw3
else
serout C.1,N4800_8,("SW4",0)
goto pollsw3
endif
Pollsw3:
If pinc.3 = 1 then
serout C.1,N4800_8,("SW3",1)
goto pollsw2
else
serout C.1,N4800_8,("SW3",0)
goto pollsw2
endif
Pollsw2:
If pinc.2 = 1 then
serout C.1,N4800_8,("SW2",1)
goto pollsw4
else
serout C.1,N4800_8,("SW2",0)
goto pollsw4
endif
The 08m2 'receiver' chip and code works fine, inputting the serial data and responding to switch 3 by flashing an led.
Code:
setfreq m4
disconnect
Poll:
serin 5, N4800_8,("SW3"),b6 'input switch 3 status into variable b6
if b6 = 1 then
goto flash
else
pause 20
goto poll
endif
flash:
high C.1
pause 200
low C.1
pause 200
high C.1
pause 200
low C.1
pause 200
goto poll
14M2 'receiver' code:
Code:
setfreq m4
disconnect
output B.1
Poll:
serrxd c.5 ("SW3"),b6 'input SW3 status into variable b6
if b6 = 1 then
goto flash
else
pause 20
goto poll
endif
Flash:
high b.1
pause 200
low b.1
pause 200
high b.1
pause 200
low b.1
goto poll
Help!!!