Hi all, I'm really hoping someone could help me out here because this really had come at me sideways. Over the last few months I've been using 4 Adafruit PCA9685 PWM expanders that I've soldered together on some Perfboard (so that the SDA line from one carries over to the next, so on and so on). This system has been working great for months, but recently I went to put it in a box and tidy the system up, and now it doesn't work. I stripped back all my extra hardware, tried 2 Arduinos, tried using the pwmtest script provided in the library for these parts. Data lines into the first expander are fine, but the first pin (0) of the first expander (default address) won't even turn on, this never happened before. Does anyone know whats going on? I would be super grateful for any ideas at all, this could not have come at a worse time.
Thanks!!
Adafruit PWM Expanders help!!!!
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- WillFaust
- Posts: 9
- Joined: Sun Jul 04, 2021 9:27 am
Adafruit PWM Expanders help!!!!
- Attachments
-
- 16263754320413442928316277975032.jpg (722.27 KiB) Viewed 111 times
-
- 16263753646567838425442984040821.jpg (702.18 KiB) Viewed 111 times
- adafruit_support_bill
- Posts: 88092
- Joined: Sat Feb 07, 2009 10:11 am
Re: Adafruit PWM Expanders help!!!!
What do you see in the serial monitor when you run the i2c scanner?
https://playground.arduino.cc/Main/I2cScanner/
https://playground.arduino.cc/Main/I2cScanner/
- WillFaust
- Posts: 9
- Joined: Sun Jul 04, 2021 9:27 am
Re: Adafruit PWM Expanders help!!!!
Hello,
I compiled and built that script you linked, and it seems to be hanging on 'scanning...'. Ive been waiting a while now. Is this normal? From looking at the code this does not seem like it should be a feature of the script?
EDIT: I had a look and it seems to get stuck on these lines: Wire.beginTransmission(address);
error = Wire.endTransmission();
Presumably the reason my devices are acting up is the same reason that the wire functions arn't working?
I compiled and built that script you linked, and it seems to be hanging on 'scanning...'. Ive been waiting a while now. Is this normal? From looking at the code this does not seem like it should be a feature of the script?
EDIT: I had a look and it seems to get stuck on these lines: Wire.beginTransmission(address);
error = Wire.endTransmission();
Presumably the reason my devices are acting up is the same reason that the wire functions arn't working?
Last edited by WillFaust on Thu Jul 15, 2021 3:55 pm, edited 1 time in total.
- adafruit_support_bill
- Posts: 88092
- Joined: Sat Feb 07, 2009 10:11 am
Re: Adafruit PWM Expanders help!!!!
Wire.h is part of the standard Arduino IDE. If the compiler can't find it, you may have a corrupted IDE and need to re-install.
That said, if you are seeing "scanning...." in the serial monitor, then it must have managed to upload the code and is actually running,
Hanging at that point is usually a symptom of a bad connection on the i2c bus. Since the problem started when you were packaging things up, the most likely problem is a marginal connection somewhere that got disturbed as you were moving things around.
That said, if you are seeing "scanning...." in the serial monitor, then it must have managed to upload the code and is actually running,
Hanging at that point is usually a symptom of a bad connection on the i2c bus. Since the problem started when you were packaging things up, the most likely problem is a marginal connection somewhere that got disturbed as you were moving things around.
- WillFaust
- Posts: 9
- Joined: Sun Jul 04, 2021 9:27 am
Re: Adafruit PWM Expanders help!!!!
Yes the wire header file was just my silly mistake, sorry about that. I will re-solder the jumper wires to the pins and see if that helps, and report back!
- WillFaust
- Posts: 9
- Joined: Sun Jul 04, 2021 9:27 am
Re: Adafruit PWM Expanders help!!!!
Hi,
Unfortunately, I just resoldered the jumper wires for SDA, SCL, PW and GRD (all the input leads to the first expander) and the code is still hanging- I guess that didnt fix the problem. Do you have any suggestions please?
Unfortunately, I just resoldered the jumper wires for SDA, SCL, PW and GRD (all the input leads to the first expander) and the code is still hanging- I guess that didnt fix the problem. Do you have any suggestions please?
- adafruit_support_bill
- Posts: 88092
- Joined: Sat Feb 07, 2009 10:11 am
Re: Adafruit PWM Expanders help!!!!
i2c is a bus. All of the connections are important because they are all wired in parallel. A bad connection to any one of the boards can cause the bus to hang.
Try to simplify your configuration. Disconnect all but one of the boards and see if the scanner can detect it.
Try to simplify your configuration. Disconnect all but one of the boards and see if the scanner can detect it.
- WillFaust
- Posts: 9
- Joined: Sun Jul 04, 2021 9:27 am
Re: Adafruit PWM Expanders help!!!!
Ah, I see. I will do a whole disassembly tomorrow and report back! Thank you so much!
- WillFaust
- Posts: 9
- Joined: Sun Jul 04, 2021 9:27 am
Re: Adafruit PWM Expanders help!!!!
Hello,
Just to update this thread incase anyone else comes across the issue. I believe I have solved it- this is the problem. I originally had 5 expanders, and I wanted to get rid of #5. What I did to remove this was to just tp physcially cut the lines that connect the GRD, SCL, SDA lines (ect) from #4 to #5 in half. This meant there were wires going from #4's output to nowhere- I believe this caused a problem where the I2C lines were open and I couldn't establish a proper connection with the devices. Thank you for your help!
Just to update this thread incase anyone else comes across the issue. I believe I have solved it- this is the problem. I originally had 5 expanders, and I wanted to get rid of #5. What I did to remove this was to just tp physcially cut the lines that connect the GRD, SCL, SDA lines (ect) from #4 to #5 in half. This meant there were wires going from #4's output to nowhere- I believe this caused a problem where the I2C lines were open and I couldn't establish a proper connection with the devices. Thank you for your help!
- adafruit_support_bill
- Posts: 88092
- Joined: Sat Feb 07, 2009 10:11 am
Re: Adafruit PWM Expanders help!!!!
It is unlikely that was the problem. The i2c bus does not require termination. And even without wires attached, you still have unterminated traces on the board.This meant there were wires going from #4's output to nowhere- I believe this caused a problem where the I2C lines were open and I couldn't establish a proper connection with the devices.
Please be positive and constructive with your questions and comments.