16-Channel 12-bit PWM/Servo Driver PWM signal not working

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
rnp_sund
 
Posts: 7
Joined: Tue Jun 12, 2018 8:56 am

16-Channel 12-bit PWM/Servo Driver PWM signal not working

Post by rnp_sund »

Hi,

I bought the 16-Channel 12-bit PWM/Servo Driver and it worked for a couple of days. But now, the PWM pin output is not working. How do I diagnose the problem? When I measure using a multi-meter, it spits out random values in mV and the duty cycle is always 0. Thanks for the help!
Last edited by rnp_sund on Wed Sep 19, 2018 11:09 am, edited 2 times in total.

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

Re: 16-Channel 12-bit PWM/Servo Driver PWM signal not workin

Post by adafruit_support_bill »

Please post photos showing your soldering and connections to the shield.

User avatar
rnp_sund
 
Posts: 7
Joined: Tue Jun 12, 2018 8:56 am

Re: 16-Channel 12-bit PWM/Servo Driver PWM signal not workin

Post by rnp_sund »

Hi,

Thanks for the reply! Sorry for the late response. Had bought a new board and it worked once and then it too stopped working!

Step Down Convertor Pic:

https://imgur.com/HU6oGWw

OpenCR1.0 pic (Arduino like board):

http://emanual.robotis.com/docs/en/part ... /opencr10/

https://imgur.com/yrKr3sf

Servo Driver:

https://imgur.com/VSpWPOs

I checked voltage values and looked for shorts at various locations. The input is 6V and no shorts anywhere. The voltage at all the PWM pins is always 0.

What should be the voltage values at SCL and SDA pins? When I gave max pulselen value, it was 5V at both.

Code:

Code: Select all

#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>

// called this way, it uses the default address 0x40
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();
// you can also call it with a different address you want
//Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver(0x41);
// you can also call it with a different address and I2C interface
//Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver(&Wire, 0x40);

// Depending on your servo make, the pulse width min and max may vary, you 
// want these to be as small/large as possible without hitting the hard stop
// for max range. You'll have to tweak them as necessary to match the servos you
// have!
#define SERVOMIN  150 // this is the 'minimum' pulse length count (out of 4096)
#define SERVOMAX  520 // this is the 'maximum' pulse length count (out of 4096)

// our servo # counter
uint8_t servonum = 0;
int ideal_speed = 70;  //deg/sec
int ideal_delay = 5; //for ideal speed
int req_speed = 50;
float req_delay= (ideal_delay*ideal_speed)/req_speed;

void setup() {
  Serial.begin(115200);
  Serial.println("8 channel Servo test!");

  pwm.begin();
  
  pwm.setPWMFreq(60);  // Analog servos run at ~60 Hz updates

  delay(10);
}

void loop() {
  // Drive each servo one at a time
  for (uint16_t pulselen = SERVOMIN; pulselen < SERVOMAX; pulselen++) {
    pwm.setPWM(6, 0, SERVOMAX);
    //pwm.setPWM(5, 0, SERVOMAX);
    Serial.println(pulselen);
    //delay(500);
    delay((int)req_delay);
  }

  delay(150);
  for (uint16_t pulselen = SERVOMAX; pulselen > SERVOMIN; pulselen--) {
    pwm.setPWM(6, 0, SERVOMAX);
    //pwm.setPWM(5, 0, SERVOMAX);
    Serial.println(pulselen);
    //delay(500);
    delay((int)req_delay);
  }
}
Thanks!

Best,
Prasanna

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

Re: 16-Channel 12-bit PWM/Servo Driver PWM signal not workin

Post by adafruit_support_bill »

The voltages on the SDA/SCL pins are normally HIGH (5v). They will briefly go LOW (0v) when sending commands. But that will be much too fast to see with a multimeter.

Run the i2c scanner code here and post the output: https://playground.arduino.cc/Main/I2cScanner

User avatar
rnp_sund
 
Posts: 7
Joined: Tue Jun 12, 2018 8:56 am

Re: 16-Channel 12-bit PWM/Servo Driver PWM signal not workin

Post by rnp_sund »

That was a super quick response! Here is the output:

I2C Scanner
Scanning...
No I2C devices found

Scanning...
No I2C devices found

repeats itself

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

Re: 16-Channel 12-bit PWM/Servo Driver PWM signal not workin

Post by adafruit_support_bill »

Make sure that you are connecting SDA and SCL to the correct pins on your processor board. That uses a different processor than the Arduino UNO, so the SDA and SCL pins may be in a different location.

User avatar
rnp_sund
 
Posts: 7
Joined: Tue Jun 12, 2018 8:56 am

Re: 16-Channel 12-bit PWM/Servo Driver PWM signal not workin

Post by rnp_sund »

That was the issue! Even though in their datasheet pins, A4 and A5 are the i2c pins, in reality its just 14 and 15. Thanks a lot!

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

Re: 16-Channel 12-bit PWM/Servo Driver PWM signal not workin

Post by adafruit_support_bill »

Good to hear you got it working. Thanks for the follow-up.

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

Return to “Other Arduino products from Adafruit”