Adafruit-PWM-Servo-Driver-Library icon indicating copy to clipboard operation
Adafruit-PWM-Servo-Driver-Library copied to clipboard

Error in restart command description

Open HsingyouZhou opened this issue 8 months ago • 0 comments

I'm confused that command reset() cannot set all registers to default. Now I get the reason:

MODE1_RESTART can only be used to RESTART the device rather than RESETTING it:

https://github.com/adafruit/Adafruit-PWM-Servo-Driver-Library/blob/73cf3ecc79c7c33a72f8ce1a3d91ca556cd34ab3/Adafruit_PWMServoDriver.cpp#L87-L93

PCA9685 has a power-down storage function, so there is no way to confuse RESTART and RESET. The biggest problem is that many PCA9685 boards do not use EXTCLK. I accidentally set EXTCLK to 1 and the servo did not work anymore. The ONLY way to clear this flag is by RESETTING it.

However, the reset process is quite special, either using a special power-up process to perform the reset or writing 0x06 to a "ghost device" with a 0x00 address.

Image

At the moment I can't find a good way to integrate the reset function into it, so I can only open a separate i2c instance with the address of 0x00 to achieve this.

HsingyouZhou avatar Apr 01 '25 07:04 HsingyouZhou