Hello All,
I am attempting to communicate between multiple picaxe chips using SERIN/SEROUT with command confirmations.
Following the code below I can tell you that C.7 on the Master Control Chip (28X2) successfully goes HIGH if I communicate with only 2 other chips. When I get to the 3rd, the 3rd being the (OUTPUT 40X2) it confirms the serial data by lighting it's LED on A.5, but the Master Control chip (28X2) doesn't appear to accept the serial confirmation and the Master Control Chip gets stuck retrying over and over.
I have searched online for what may be causing this issue to no avail. I did read about a FIFO buffer, but am uncertain how to address this in software.
It may be worth noting that I can remove any 2 sections of the code for chip communications from the Master and C.7 happily goes HIGH.
Thanks in advance for any help it is greatly appreciated.
Master Control Chip
Voltage Selector Chip
SMPS PWM Chip
Output Control Chip
Indicators Control Chip
I appreciate it may not be necessary to go to this trouble for confirmations, but I do want it and hope I can simply use SERIN/SEROUT as shown in the above code.
Regards,
TJ.
I am attempting to communicate between multiple picaxe chips using SERIN/SEROUT with command confirmations.
Following the code below I can tell you that C.7 on the Master Control Chip (28X2) successfully goes HIGH if I communicate with only 2 other chips. When I get to the 3rd, the 3rd being the (OUTPUT 40X2) it confirms the serial data by lighting it's LED on A.5, but the Master Control chip (28X2) doesn't appear to accept the serial confirmation and the Master Control Chip gets stuck retrying over and over.
I have searched online for what may be causing this issue to no avail. I did read about a FIFO buffer, but am uncertain how to address this in software.
It may be worth noting that I can remove any 2 sections of the code for chip communications from the Master and C.7 happily goes HIGH.
Thanks in advance for any help it is greatly appreciated.
Master Control Chip
Code:
'28X2 Master Control
init:
setfreq m16
low c.2 'Set Comms pin LOW ready for N serial communications.
'Confirm Comms link to ALL Chips.
pause 100 'Initial settling time for ALL chips at power on.
voltadjusttest:
let b0=1 'Initial Comms KEY
low c.2 'Bring line low ready for Comms
pause 10
serout c.2, N2400_16, ("VOLTADJUST", b0)
serin [50, voltadjusttest], c.2, N2400_16, ("VOLTADJUST"), b0
if b0=2 then goto smpstest
goto voltadjusttest
smpstest:
let b0=1 'Initial Comms KEY
low c.2 'Bring line low ready for Comms
pause 10
serout c.2, N2400_16, ("SMPSPWM", b0)
serin [50, smpstest], c.2, N2400_16, ("SMPSPWM"), b0
if b0=2 then goto outputtest
goto smpstest
outputtest:
let b0=1 'Initial Comms KEY
low c.2 'Bring line low ready for Comms
pause 10
serout c.2, N2400_16, ("OUTPUT", b0)
serin [50, outputtest], c.2, N2400_16, ("OUTPUT"), b0
if b0=2 then goto indictest
goto outputtest
indictest:
let b0=1 'Initial Comms KEY
low c.2 'Bring line low ready for Comms
pause 10
serout c.2, N2400_16, ("INDICATORS", b0)
serin [50, indictest], c.2, N2400_16, ("INDICATORS"), b0
if b0=2 then goto commsok
goto indictest
commsok:
high c.7 'Light LED confirming serial communications processed.
end
Voltage Selector Chip
Code:
'08M2 - Voltage Adjust Control
init:
setfreq m16
initialtest:
serin [50,initialtest], c.4, N2400_16, ("VOLTADJUST"), b0
if b0=1 then let b0=2 serout c.4, N2400_16, ("VOLTADJUST", b0) goto ready endif
goto initialtest
ready:
high c.0 'Light LED confirming serial communications.
end
SMPS PWM Chip
Code:
'08M2 - SMPS PWM Control
init:
setfreq m16
initialtest:
serin [50,initialtest], c.4, N2400_16, ("SMPSPWM"), b0
if b0=1 then let b0=2 serout c.4, N2400_16, ("SMPSPWM", b0) goto ready endif
goto initialtest
ready:
high c.0 'Light LED confirming serial communications.
end
Output Control Chip
Code:
'40X2 - Output Control
init:
setfreq m16
initialtest:
serin [50,initialtest], a.0, N2400_16, ("OUTPUT"), b0
if b0=1 then let b0=2 serout a.0, N2400_16, ("OUTPUT", b0) goto ready endif
goto initialtest
ready:
high a.5 'Light LED confirming serial communications.
end
Indicators Control Chip
Code:
'28X2 - Indicators Control
init:
setfreq m16
initialtest:
serin [50,initialtest], a.3, N2400_16, ("INDICATORS"), b0
if b0=1 then let b0=2 serout a.3, N2400_16, ("INDICATORS", b0) goto ready endif
goto initialtest
ready:
high a.4 'Light LED confirming serial communications.
end
I appreciate it may not be necessary to go to this trouble for confirmations, but I do want it and hope I can simply use SERIN/SEROUT as shown in the above code.
Regards,
TJ.