Require a Device Address in the I2C Bus Configuration Menu #229
-
For validation purposes, greater clarity, and to simplify programming, you should be required to specify the I2C addresses of the devices on a I2C Bus in the I2C Bus Configuration Menu as follows: The When adding a device in the I2C Bus Configuration Menu, the Address of the device can be populated with a default non-conflicting address (or error if non-conflicting addresses have been exhausted on the bus). The driver implementation could provide a method that verifies the existence of the device (reads or writes a register on the device). You shouldn't have to hardcode I2C addresses in your OpModes. I2C addresses should be required to be entered in the I2C Bus Configuration Menu where devices and addresses can be validated at configure-robot time, and addresses can be changed without having to re-build the RC App. I am a novice when it comes to I2C devices. Am I missing something? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Thanks for the suggestion. You did an excellent job providing a visual and technical summary of your idea. However, extremely few I2C devices have the ability to set an arbitrary address. By far the most common case is that you have two address choices, and you pick between them by pulling a pin either to high or to ground, which is not applicable to most sensors FTC teams are using. As a reminder, every I2C port on Control Hubs and Expansion Hubs has its own dedicated I2C bus, so you don't have to worry about I2C address conflicts. I notice in the screenshot that you have all Modern Robotics sensors. Those are the only sensors I can recall seeing that allow you to set arbitrary I2C addresses, so I can understand why this feature would be valuable to you. Changeable I2C addresses were only necessary for the old Modern Robotics CDIM, which is no longer supported. This use-case seems to only benefit teams who have heavily invested in the legacy MR sensor ecosystem and have made a custom wiring harness to allow multiple sensors to be on the same I2C bus. For the amount of effort, complexity, and testing needed, this is an unlikely feature to be added. However, we do appreciate the suggestion. |
Beta Was this translation helpful? Give feedback.
Thanks for the suggestion. You did an excellent job providing a visual and technical summary of your idea.
However, extremely few I2C devices have the ability to set an arbitrary address. By far the most common case is that you have two address choices, and you pick between them by pulling a pin either to high or to ground, which is not applicable to most sensors FTC teams are using.
As a reminder, every I2C port on Control Hubs and Expansion Hubs has its own dedicated I2C bus, so you don't have to worry about I2C address conflicts. I notice in the screenshot that you have all Modern Robotics sensors. Those are the only sensors I can recall seeing that allow you to set arbitrary I2C addre…