0

PCA9685 intermittent failure
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

PCA9685 intermittent failure

by sterzy on Wed Jul 21, 2021 10:52 pm

I am working on a project that has many peripherals being run on separate threads. I am having intermittent issues where the PCA9685 is causing the I2C bus to crash and all sensors fail to write data. I have isolated it down to just the PCA9685. It is using a UMFT4222ED-D for a processor. All comms are being run over I2C.

The intermittent nature of the issue is making it rather hard to troubleshoot. Sometimes the failure occurs when setting duty in a start condition, and others when setting duty cycle in a stop condition. In my testing this occurs roughly within 1-50 start/stop cycles.

General cod description:

Code: Select all | TOGGLE FULL SIZE
pca.frequency = 60
pca.channels[0].duty_cycle = 0xFFFF
pca.channels[1].duty_cycle = 0x0000
time.sleep(5)
pca.frequency = 60
pca.channels[0].duty_cycle = 0x0000
pca.channels[1].duty_cycle = 0x0000
time.sleep(5)


Any help is greatly appreciated. I have been fighting this for weeks and would like to move forward in my project.

Thanks
Attachments
PCA9685.JPG
Wiring Diagram
PCA9685.JPG (176.76 KiB) Viewed 63 times

sterzy
 
Posts: 8
Joined: Thu Jun 17, 2021 1:42 pm

Re: PCA9685 intermittent failure

by adafruit_support_bill on Thu Jul 22, 2021 5:23 am

I am working on a project that has many peripherals being run on separate threads.

Are you attempting to do i2c communication from multiple threads? That would require some synchronization since i2c is a serial bus.

adafruit_support_bill
 
Posts: 81544
Joined: Sat Feb 07, 2009 10:11 am

Re: PCA9685 intermittent failure

by sterzy on Thu Jul 22, 2021 8:19 am

I am in the larger project. We are managing the this by locking the bus when a device is using it though.

In our troubleshooting, we have isolated this down to the PCA and have replicated the issue by running only this thread. That being said, we should not be having any conflicts on the I2C bus currently.

sterzy
 
Posts: 8
Joined: Thu Jun 17, 2021 1:42 pm

Re: PCA9685 intermittent failure

by adafruit_support_bill on Thu Jul 22, 2021 9:03 am

Please post some photos showing your soldering and connections.

adafruit_support_bill
 
Posts: 81544
Joined: Sat Feb 07, 2009 10:11 am

Re: PCA9685 intermittent failure

by sterzy on Thu Jul 22, 2021 1:19 pm

Photo of PCA9685
Attachments
IMG_8951.jpg
IMG_8951.jpg (373.02 KiB) Viewed 45 times

sterzy
 
Posts: 8
Joined: Thu Jun 17, 2021 1:42 pm

Re: PCA9685 intermittent failure

by adafruit_support_bill on Thu Jul 22, 2021 2:28 pm

The soldering looks fine. Please also post photos showing your connections between the boards.

adafruit_support_bill
 
Posts: 81544
Joined: Sat Feb 07, 2009 10:11 am

Re: PCA9685 intermittent failure

by sterzy on Thu Jul 22, 2021 3:33 pm

When i replicated the issue on my bench top and running only the single thread, I wired as depicted below.
Attachments
IMG_8953.jpg
IMG_8953.jpg (636.57 KiB) Viewed 43 times

sterzy
 
Posts: 8
Joined: Thu Jun 17, 2021 1:42 pm

Re: PCA9685 intermittent failure

by adafruit_support_bill on Thu Jul 22, 2021 3:44 pm

So there was nothing else on the bus and nothing connected to the PCA9685? Your circuit diagram shows a DRV8871 driving a pump motor.

adafruit_support_bill
 
Posts: 81544
Joined: Sat Feb 07, 2009 10:11 am

Re: PCA9685 intermittent failure

by sterzy on Thu Jul 22, 2021 3:58 pm

When connected in the network there are multiple peripherals on the I2C bus and as the wiring diagram shows, a DRV8871 running a small pump. In my bench top experiment to determine if there were other devices contributing, I only had the FT4222 and PCA9685 connected per the picture posted. When I ran the bench top experiment, I was able to replicate the failure. The failure was the same as seen when the PCA9685 was in the network of additional devices.

sterzy
 
Posts: 8
Joined: Thu Jun 17, 2021 1:42 pm

Re: PCA9685 intermittent failure

by adafruit_support_bill on Thu Jul 22, 2021 4:03 pm

We can try replacing the board. Please contact support@adafruit.com with a link to this thread and we can get one out to you.

adafruit_support_bill
 
Posts: 81544
Joined: Sat Feb 07, 2009 10:11 am

Re: PCA9685 intermittent failure

by sterzy on Thu Jul 22, 2021 4:10 pm

I have tried this across 4 different boards and yielded the same result. Is it possible there is a problem with an entire lot of boards?

sterzy
 
Posts: 8
Joined: Thu Jun 17, 2021 1:42 pm

Re: PCA9685 intermittent failure

by adafruit_support_bill on Thu Jul 22, 2021 5:07 pm

Not likely. We sell many tens of thousands of PCA9685-based boards and I haven't seen a bad one in quite a long time. The probability of you getting the only 4 bad ones is vanishingly small.

The overwhelming majority of i2c bus hanging problems are due to physical problems with the bus or interference. It can be marginal connections, too long a distance or a nearby source of interference (e.g. motors, relays, heating elements, fluorescent lights etc.).

Occasionally we will see someone attempting multi-threaded communication which never goes well. But we seem to have ruled that out.

What speed are you running the bus at? The chip is rated for up to 1MHz. But high speed will magnify any physical issues with the bus.

adafruit_support_bill
 
Posts: 81544
Joined: Sat Feb 07, 2009 10:11 am

Re: PCA9685 intermittent failure

by sterzy on Thu Jul 22, 2021 10:18 pm

I tested the board at different speeds and still had failure this afternoon. I was reading through the data sheet. and it looked like each channel is rated at 25mA per channel. Looking at my setup, I am drawing 78mA when Set the frequency to 60 and duty cycle to 100. Could this lead to an intermittent brown out condition? Also, can you confirm the 25mA per channel rating when powered from the 3V3 rail?

sterzy
 
Posts: 8
Joined: Thu Jun 17, 2021 1:42 pm

Re: PCA9685 intermittent failure

by adafruit_support_bill on Fri Jul 23, 2021 5:29 am

How are you measuring that? There is a 220 ohm resistor in series with each of the PWM pins on the board. At 3.3v, you should not be able to draw more than 15mA. And with nothing connected as in the test circuit shown above, there should be no current draw at all from the pin.

adafruit_support_bill
 
Posts: 81544
Joined: Sat Feb 07, 2009 10:11 am

Please be positive and constructive with your questions and comments.