Arduino-FOC
Arduino-FOC copied to clipboard
Use AS5600 auto increment suppress
This IC does not increment I2C read pointer when the angle is read for performance reasons. There is no need to rewrite the register address on an every request.
This makes angle query practically almost twice as fast. I've tested this only on AS5600 so feature is disabled by default for other I2C comms based sensors.
Hi @tikonen , thank you for contributing this but actually we already support this in our dedicated driver for the AS5600:
https://github.com/simplefoc/Arduino-FOC-drivers/tree/master/src/encoders/as5600
This driver additionally keeps the I2C transactions open and in my tests achieves significantly higher read rates than our regular driver. It also has the advantage of being able to read/write the sensors other registers. So I think I’d prefer to keep the MagneticSensorI2C driver really basic and free of hardware-specific functions, since we have the dedicated drivers for the people who want them.
No problem. My thinking was as the driver had explicit configuration for AS5600 this might go in as optional functionality but it makes sense to keep it simple if there is already dedicated high performance driver available.
Then I will close this one, thank you!