PCA9685 intermittent failure

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
sterzy
 
Posts: 8
Joined: Thu Jun 17, 2021 1:42 pm

PCA9685 intermittent failure

Post by sterzy »

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

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
Wiring Diagram
Wiring Diagram
PCA9685.JPG (176.76 KiB) Viewed 245 times

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: PCA9685 intermittent failure

Post by adafruit_support_bill »

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.

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

Re: PCA9685 intermittent failure

Post by sterzy »

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.

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: PCA9685 intermittent failure

Post by adafruit_support_bill »

Please post some photos showing your soldering and connections.

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

Re: PCA9685 intermittent failure

Post by sterzy »

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

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: PCA9685 intermittent failure

Post by adafruit_support_bill »

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

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

Re: PCA9685 intermittent failure

Post by sterzy »

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 225 times

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: PCA9685 intermittent failure

Post by adafruit_support_bill »

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

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

Re: PCA9685 intermittent failure

Post by sterzy »

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.

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: PCA9685 intermittent failure

Post by adafruit_support_bill »

We can try replacing the board. Please contact [email protected] with a link to this thread and we can get one out to you.

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

Re: PCA9685 intermittent failure

Post by sterzy »

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?

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: PCA9685 intermittent failure

Post by adafruit_support_bill »

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.

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

Re: PCA9685 intermittent failure

Post by sterzy »

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?

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: PCA9685 intermittent failure

Post by adafruit_support_bill »

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.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”