I havent had a chance to look at your link yet.
I've been tweaking the Master and Slave PBP code trying to get a final version ready before I install my pack in the car and access to the slaves becomes difficult.
Some earlier code is working fine in the bench.
The experimental code I am working on has a few new features for the slaves.
The new command list is below and i have tried to group the commands together so it is easier to understand. I'll explain the less obvious ones below.
'************** Slave Commands *********************
' Command 01 = Send Cell Voltage on Master Bus (0.1ms pulse)
' Command 02 = Turn Off Loads (Multi Slave Mode Only) (0.2ms pulse)
' Command 03 = Turn On Loads as Reqd (Multi Slave Mode Only) (0.3ms pulse)
' Command 04 = Increase Load CutIn Voltage by 10mv (0.4ms pulse)
' Command 05 = Decrease Load CutIn Voltage by 10mv (0.5ms pulse)
' Command 06 = Increase Load CutOut Voltage by 10mv (0.6ms pulse)
' Command 07 = Decrease Load CutOut Voltage by 10mv (0.7ms pulse)
' Command 08 = Set Slave Load CutIn/CutOut Voltage Defaults (0.8ms pulse)
' Command 09 = Turn On Slave Load for 0.5 seconds (Flash Led) (0.9ms pulse)
' Command 10 = Set Baud rate to 9600bps (Default) (1.0ms pulse)
' Command 11 = Set Baud rate to 2400bps (1.1ms pulse)
' Command 12 = Report Slave Software Version Number (1.2ms pulse)
' Command 13 = Set to Multi Slave (Multi Slave Mode) Default (1.3ms pulse)
' Command 14 = Set to Single Slave (Single Slave Mode) (1.4ms pulse)
' Command 15 = Increase Command Delay Time by 1ms (Max 10ms) (1.5ms pulse)
' Command 16 = Decrease Command Delay Time by 1ms (Min 0ms) (1.6ms pulse)
' Command 17 = Set Default Command Delay Time (3ms) (1.7ms pulse)
' Command 18 = Increase FailLow Cut Off Voltage by 5mv (1.8ms pulse)
' Command 19 = Decrease FailLow Cut Off Voltage by 5mv (1.9ms pulse)
' Command 20 = Set FailLow Cut Off Voltage to Default 3.35V (2.0ms pulse)
' Command 21 = Set ADC Output Voltage to 3.70V (Test Mode) (2.1ms pulse)
' Command 22 = Set ADC Output Voltage to Cell Voltage (Default) (2.2ms pulse)
' Command 23 = Increase FailHigh Cut in Voltage by 5mv (2.3ms pulse)
' Command 24 = Decrease FailHigh Cut in Voltage by 5mv (2.4ms pulse)
' Command 25 = Set FailHigh Cut in Voltage to Default 3.85V (2.5ms pulse)
' Command 26 = Set Slave to Super (No command echo) (2.6ms pulse)
' Command 27 = Set Slave to Normal (command echo) Default (2.7ms pulse)
The slaves can now operate in several modes. The first 12 commands are fairly self explanatory. So starting with
Command 13. This sets the slaves to Multi Slave board mode, and the slaves then respond to Commands 2 & 3 to control the Loads, which avoids the voltage drop issue and adjacent slave interference. This should be used for all multi slave boards
Command 14. This sets the slaves to Single Slave board mode, and the slaves will ignore commands 2 & 3 and will control the loads themselves.
Command 15 - 17 These control the Slave command propagation delay time, it is adjustable between 0-10ms. A shorter delays means faster slave response, but if you go too low the slaves may miss commands. If you jam then with this command and get the command error when updating, then powering them down and back up will reset them to the defaults.
Command 18 - 20 These control the fail safe low voltage load cut off point to stop cell overdischarge. This overides the cell load on/off control and is especially relevant when the slaves are operating in the multi slave mode, as in this mode the slave load on/off depends upon commands 2 & 3 being sent by the master. The fail safe point can be adjusted up or down. Default is 3.35v which is around the resting voltage for lifep04 cells. The load will always be turned off if the cell voltage falls below this point.
Command 21 - 22 These control the Cell Voltage detection routine and allow the ADC to report the actual cell voltage or a simulated test voltage of 3.70V. This must always be set to report the actual cell voltage in use. The simulated test mode 3.70V is useful to ensure the slave loads respond correctly and come on etc.
Command 23 - 25 These control the fail safe high voltage load cut in point to stop cell overcharge. This overides the cell load on/off control and is especially relevant when the slaves are operating in the multi slave mode, as in this mode the slave load on/off depends upon commands 2 & 3 being sent by the master. The fail safe point can be adjusted up or down. Default is 3.85v which is around the maximum voltage for lifep04 cells. The load will always be turned on if the cell voltage rises above this point.
Command 26 - 27 These control the Super slaves mode. The default is normal mode in which the commands (Except No 1) are all echoed back on the Master Bus. In super mode commands 1,2 & 3 are not echoed back and this allows a faster master/slave response time in normal multi slave board operation.
Some other enhancements are
Slave Code. Improvements in the slave code to detect if a slave or the master is stuck at the command reception/transmission point. This means if a slave is stuck with the slave bus ouput low (calling the next slave) the following slave will be stuck waiting for a command that never arrives. The reception loop now times, out at least allowing the receiving slave to continue with the basic housekeeping and control of the fail safe cell voltages.
I hope to use the internal watchdog timer at some point to implement better slave lock up prevention.
Master Code. Minor changes to prevent unsupported commands being sent to the slaves
I'll publish these versions when all tested and OK.