kevinbrinkley
New Member
Hello,
My setup is:
28x2 - Collects and processes data from a number of 20x2 devices. These read their C pins and send the binary code o their state to the 28x2.
There are planned to be 12 20x2 in total all connected to the b.0 (serin on 28x2) and b.1 (serout on 28x2) pins of the 28x2. I am testing in VSM with just 2 actively at present.
The 28x2 sends a code along the line to the 20x2s with a qualifier to identify the correct 20x2. On receiving the correct qualifier, the 20x2 sends back the data.
When running the simulation, the first chip, regardless of which it is, always works.
However, the second always fails as the 28x2 fails to recognise the input it receives from the 20x2. the 20x3 does receive the qualifier and does send the signal.
I have so far tried:
Different baud rates
Calibfreq
Different setfreq values
Any other suggestions are very welcome
Thank you in advance.
The Code
On the 28x2:
COLLECT_DATA:
GOSUB POINTS1
GOSUB POINTS2
'GOSUB POINTS3
'GOSUB POINTS4
'GOSUB TOTI1
'GOSUB TOTI2
'GOSUB TOTI3
'GOSUB TOTI4
'GOSUB SWITCH1
'GOSUB SWITCH2
'GOSUB SWITCH3
'GOSUB SWITCH4
RETURN
POINTS1:
SEROUT SERIAL_OUT_INPUTS, N2400, ("WAKE")
PAUSE 10
SEROUT SERIAL_OUT_INPUTS, N2400, ("POINTS1")
PAUSE 10
SERIN [50, POINTS1], SERIAL_IN_INPUTS, N2400, ("POINTS1"), b0
PAUSE 10
RETURN
POINTS2:
SEROUT SERIAL_OUT_INPUTS, N2400, ("WAKE")
PAUSE 10
SEROUT SERIAL_OUT_INPUTS, N2400, ("PT2")
PAUSE 10
SERIN [50, POINTS2], SERIAL_IN_INPUTS, N2400, ("POINTS2"), b1 'FALLS OVER HERE, REGARDLESS OF TIMEOUT.
PAUSE 10
RETURN
On the 20x2 ("Points2" can be subbed for "Points1" etc)
MAIN:
GOSUB READ_PINS
GOSUB RECIEVE
GOSUB TRANSMIT
GOTO MAIN
END
READ_PINS:
b0 = pinsC
RETURN
RECIEVE:
SERIN SERIAL_IN, N2400, ("POINTS2")
PAUSE 10
RETURN
TRANSMIT:
SEROUT SERIAL_OUT, N2400, ("WAKE")
PAUSE 10
SEROUT SERIAL_OUT, N2400, ("POINTS2", b0)
PAUSE 10
RETURN
My setup is:
28x2 - Collects and processes data from a number of 20x2 devices. These read their C pins and send the binary code o their state to the 28x2.
There are planned to be 12 20x2 in total all connected to the b.0 (serin on 28x2) and b.1 (serout on 28x2) pins of the 28x2. I am testing in VSM with just 2 actively at present.
The 28x2 sends a code along the line to the 20x2s with a qualifier to identify the correct 20x2. On receiving the correct qualifier, the 20x2 sends back the data.
When running the simulation, the first chip, regardless of which it is, always works.
However, the second always fails as the 28x2 fails to recognise the input it receives from the 20x2. the 20x3 does receive the qualifier and does send the signal.
I have so far tried:
Different baud rates
Calibfreq
Different setfreq values
Any other suggestions are very welcome
Thank you in advance.
The Code
On the 28x2:
COLLECT_DATA:
GOSUB POINTS1
GOSUB POINTS2
'GOSUB POINTS3
'GOSUB POINTS4
'GOSUB TOTI1
'GOSUB TOTI2
'GOSUB TOTI3
'GOSUB TOTI4
'GOSUB SWITCH1
'GOSUB SWITCH2
'GOSUB SWITCH3
'GOSUB SWITCH4
RETURN
POINTS1:
SEROUT SERIAL_OUT_INPUTS, N2400, ("WAKE")
PAUSE 10
SEROUT SERIAL_OUT_INPUTS, N2400, ("POINTS1")
PAUSE 10
SERIN [50, POINTS1], SERIAL_IN_INPUTS, N2400, ("POINTS1"), b0
PAUSE 10
RETURN
POINTS2:
SEROUT SERIAL_OUT_INPUTS, N2400, ("WAKE")
PAUSE 10
SEROUT SERIAL_OUT_INPUTS, N2400, ("PT2")
PAUSE 10
SERIN [50, POINTS2], SERIAL_IN_INPUTS, N2400, ("POINTS2"), b1 'FALLS OVER HERE, REGARDLESS OF TIMEOUT.
PAUSE 10
RETURN
On the 20x2 ("Points2" can be subbed for "Points1" etc)
MAIN:
GOSUB READ_PINS
GOSUB RECIEVE
GOSUB TRANSMIT
GOTO MAIN
END
READ_PINS:
b0 = pinsC
RETURN
RECIEVE:
SERIN SERIAL_IN, N2400, ("POINTS2")
PAUSE 10
RETURN
TRANSMIT:
SEROUT SERIAL_OUT, N2400, ("WAKE")
PAUSE 10
SEROUT SERIAL_OUT, N2400, ("POINTS2", b0)
PAUSE 10
RETURN