You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix for analog expansion apparently not taking I2C address
The problem was due to the fact that I2C change address in the expansion is done in the main loop
So the expansion gets the request from the controller to change the address, but the the actual change is performed after a while in the main loop
There is no way to understand how much this can take because depends on the channel setting (for example RTD is slow and when is active the main loop is slower)
To solve this problem 3 actions were taken:
1. in the expansion the main loop only execute the Module::update() if the address is not set up (this ensure the main loop is as fast as possible)
2. in the controller the timeout for I2C set up address has been increased up to five seconds (but kept at 50 ms for any other message)
3. the controller has now a flag that continue to ask for the confirmation of a changed I2C address until the confirmation is received (send_new_address)
This flag allow the controller to set up a new address for an expansion without a valid address is received only if the previous one has confirmed it has the new address
The problem in fact was related to the fact that the expansion actually gets the address (in the main loop) but it was not able to respond in time
So the controller was setting the new address of the next expansion without understanding that the old one was there
0 commit comments