(Just untried ideas.)
Two ‘bus’ lines: ATTN and DATA. All the AXEs get on with their own business intermittently checking the ATTN line within their main loop. When the ATTN line goes high, they suspend processing and go to a data-receive subroutine. In that routine they receive four bytes: a TO address byte, a FROM address byte, a function byte, then a data byte. The TO address byte is compared with the local ID of the AXE and if not matched, the AXE returns to it’s main processing loop, ignoring the data. If there is a match, then based upon the value of the function byte, the data byte is stored/processed by that AXE.
The function byte is for routing the data once it has arrived at the intended AXE. EG. One AXE driving 3 servos, or one AXE reading three temperature sensors.
The FROM address byte is to enable two-way chatting/hand shaking for exchanging data. EG “Hey AXE5, AXE2 here, send me the low byte of your ADC1” – “Hey AXE2, AXE5 here, low byte for ADC1 is 44” – “Hey AXE5, AXE2 here, send me your high byte for ADC1” – “Hey AXE2, AXE5 here, high byte for ADC1 is 3” etc.
Whenever an AXE need’s to send data, it first does a small loop, polling the ATTN line, waiting until ATTN is low, then takes the ATTN line high, then a short pause* to make sure all the AXEs have stopped processing and are listening, then sends four bytes (TO address, FROM address, Function, Data), then takes the ATTN line low, then returns to processing.
After each AXE has received it’s 4 bytes, it performs a small loop, polling ATTN, waiting until ATTN=low to ensure it does not try to receive the same data twice.
The data could be expanded to two or more bytes as required.
*The pause needs to be chosen based upon the slowest AXE in the network. IE the AXE whose main processing loop takes the longest to perform.
Potential problems:
-Two AXEs trying to send data at exactly the same time.
-Noise effecting the data stream or the ATTN line.
-An AXE missing the data coz it’s main processing loop was slow.
-?
This is all just theory. I’m soliciting comments/ideas.
Two ‘bus’ lines: ATTN and DATA. All the AXEs get on with their own business intermittently checking the ATTN line within their main loop. When the ATTN line goes high, they suspend processing and go to a data-receive subroutine. In that routine they receive four bytes: a TO address byte, a FROM address byte, a function byte, then a data byte. The TO address byte is compared with the local ID of the AXE and if not matched, the AXE returns to it’s main processing loop, ignoring the data. If there is a match, then based upon the value of the function byte, the data byte is stored/processed by that AXE.
The function byte is for routing the data once it has arrived at the intended AXE. EG. One AXE driving 3 servos, or one AXE reading three temperature sensors.
The FROM address byte is to enable two-way chatting/hand shaking for exchanging data. EG “Hey AXE5, AXE2 here, send me the low byte of your ADC1” – “Hey AXE2, AXE5 here, low byte for ADC1 is 44” – “Hey AXE5, AXE2 here, send me your high byte for ADC1” – “Hey AXE2, AXE5 here, high byte for ADC1 is 3” etc.
Whenever an AXE need’s to send data, it first does a small loop, polling the ATTN line, waiting until ATTN is low, then takes the ATTN line high, then a short pause* to make sure all the AXEs have stopped processing and are listening, then sends four bytes (TO address, FROM address, Function, Data), then takes the ATTN line low, then returns to processing.
After each AXE has received it’s 4 bytes, it performs a small loop, polling ATTN, waiting until ATTN=low to ensure it does not try to receive the same data twice.
The data could be expanded to two or more bytes as required.
*The pause needs to be chosen based upon the slowest AXE in the network. IE the AXE whose main processing loop takes the longest to perform.
Potential problems:
-Two AXEs trying to send data at exactly the same time.
-Noise effecting the data stream or the ATTN line.
-An AXE missing the data coz it’s main processing loop was slow.
-?
This is all just theory. I’m soliciting comments/ideas.