I recently purchased an Adafruit 16-Channel 12-bit PWM/Servo Driver (http://www.adafruit.com/products/815). I've been using the Adafruit Servo Driver with Raspberry Pi tutorial to get started (http://learn.adafruit.com/adafruit-16-c ... i/overview) running a small servo motor. When I run Servo_Example.py I get the following error message:
Error accessing 0x40: Check your I2c address
The power LED on the driver blinks when I run the program.
The correct address for the driver is in the Servo_Example.py code. When I scan for I2c devices connected to my Pi, a device shows up at the 0x40 address like the driver should. I have also tried changing the following line of code in Servo_Example.py, self.i2c = Adafruit_I2C(address) to self.i2c = Adafruit_I2C(address,1) as mentioned in the tutorial, with no luck.
I'm using a breadboard and pi cobbler to connect all of the components and I've wired it exactly as shown on the "Hooking It Up" page of the tutorial (http://learn.adafruit.com/adafruit-16-c ... king-it-up)
I'm stuck and I'm not sure what the problem is. Let me know if you need anymore information. Thanks for your help!
Trouble with Adafruit 16-Channel 12-bit PWM/Servo Driver
Moderators: adafruit_support_bill, adafruit
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
- samuelm1
- Posts: 7
- Joined: Sat Jul 20, 2013 6:53 pm
- adafruit_support_bill
- Posts: 88089
- Joined: Sat Feb 07, 2009 10:11 am
Re: Trouble with Adafruit 16-Channel 12-bit PWM/Servo Driver
I've moved this to the Raspberry Pi forum.
If the board identifies in i2cdetect, then the wiring is correct. Although an intermittent connection may be preventing it from working. Make sure all your breadboard connections are solid.
If the board identifies in i2cdetect, then the wiring is correct. Although an intermittent connection may be preventing it from working. Make sure all your breadboard connections are solid.
- samuelm1
- Posts: 7
- Joined: Sat Jul 20, 2013 6:53 pm
Re: Trouble with Adafruit 16-Channel 12-bit PWM/Servo Driver
I've checked my connections and they all seem solid. I also removed the pi cobbler from my breadboard and made connections straight from the gpio pins on the Pi (just to reduce the number of connections). When I run Servo_Example.py, I get the same error message as before:
Error accessing 0x40: Check your I2c address
Again, when I scan for devices the driver shows up at the 0x40 address. The power LED on the driver also blinks as it did before. Is this because I'm getting intermittent power supply from the Pi? What could be causing this?
Any other ideas? Thanks for your help!
Error accessing 0x40: Check your I2c address
Again, when I scan for devices the driver shows up at the 0x40 address. The power LED on the driver also blinks as it did before. Is this because I'm getting intermittent power supply from the Pi? What could be causing this?
Any other ideas? Thanks for your help!
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: Trouble with Adafruit 16-Channel 12-bit PWM/Servo Driver
You must have a 256MB Pi? There is an issue with the Adafruit_I2C.py library - it attempts to detect which model Pi you have so that it can automatically select the right I2C bus. Sometimes, that process fails, and it selects the wrong I2C bus.
There is a section on correcting this problem in the tutorial:
http://learn.adafruit.com/adafruit-16-c ... it-library
There is a section on correcting this problem in the tutorial:
http://learn.adafruit.com/adafruit-16-c ... it-library
- samuelm1
- Posts: 7
- Joined: Sat Jul 20, 2013 6:53 pm
Re: Trouble with Adafruit 16-Channel 12-bit PWM/Servo Driver
I've got a 512MB Pi. I've tried inputting the i2c bus into the Adafruit_I2C.py library with the same result as before. I've also tried all of the suggestions in the tutorial for correcting this problem with no luck. Any other suggestions?
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: Trouble with Adafruit 16-Channel 12-bit PWM/Servo Driver
I'm sorry - I see now that, in your first post, you said you did all that.
The Servo Driver board has 10K ohm pullup resistors on SDA and SCL. These may be a little weak for the Pi, especially if your cables are a bit long.
Can you try adding another pair of pullup resistors to SDA and SCL? The values aren't terribly critical - anything between 5K and 10K. Put one resistor between 3.3V and SDA, and another between 3.3V and SCL
The Servo Driver board has 10K ohm pullup resistors on SDA and SCL. These may be a little weak for the Pi, especially if your cables are a bit long.
Can you try adding another pair of pullup resistors to SDA and SCL? The values aren't terribly critical - anything between 5K and 10K. Put one resistor between 3.3V and SDA, and another between 3.3V and SCL
- samuelm1
- Posts: 7
- Joined: Sat Jul 20, 2013 6:53 pm
Re: Trouble with Adafruit 16-Channel 12-bit PWM/Servo Driver
I tried adding resistors to the SDA an SCL (I tried both 4.7K and 10K). In both cases I received the same error message as before. The only difference this time was that the power LED on the driver did not come on. Normally, the LED blinks.
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: Trouble with Adafruit 16-Channel 12-bit PWM/Servo Driver
Very strange. Can you post some pictures of the board (both sides), and also a picture showing the connections to the Pi?
- samuelm1
- Posts: 7
- Joined: Sat Jul 20, 2013 6:53 pm
Re: Trouble with Adafruit 16-Channel 12-bit PWM/Servo Driver
Here are photos of both sides of the board and the connections:
- samuelm1
- Posts: 7
- Joined: Sat Jul 20, 2013 6:53 pm
Re: Trouble with Adafruit 16-Channel 12-bit PWM/Servo Driver
I posted the pictures of the top and bottom of the driver as well as a photo of the connections. I was wondering if you can see them or if you've gotten a chance to look at them. Thanks for your help.
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: Trouble with Adafruit 16-Channel 12-bit PWM/Servo Driver
I apologize - I missed the notification of your response.
Anyway, it all looks OK from here. We have seen this issue before; that is, where a device shows up in i2cdetect, but Adafruit_I2C.py can't communicate with it. It comes down to poor connections. Have a look at this thread - the problem was a wobbly GND:
http://forums.adafruit.com/viewtopic.ph ... 96#p211779
Try different jumper wires and different breadboard sockets. Your solders look OK in the picture, but it wouldn't hurt to heat them up again to make sure you have a good flow.
Anyway, it all looks OK from here. We have seen this issue before; that is, where a device shows up in i2cdetect, but Adafruit_I2C.py can't communicate with it. It comes down to poor connections. Have a look at this thread - the problem was a wobbly GND:
http://forums.adafruit.com/viewtopic.ph ... 96#p211779
Try different jumper wires and different breadboard sockets. Your solders look OK in the picture, but it wouldn't hurt to heat them up again to make sure you have a good flow.
- samuelm1
- Posts: 7
- Joined: Sat Jul 20, 2013 6:53 pm
Re: Trouble with Adafruit 16-Channel 12-bit PWM/Servo Driver
I checked all of the solders and heated them just to make sure. I also tried using different breadboard sockets with different jumper cables, but I'm still getting the same error message. Here's a picture of the i2cdetect and the error message just in case I am missing something.
- Attachments
-
- ErrorMessage.jpg (103.98 KiB) Viewed 1450 times
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: Trouble with Adafruit 16-Channel 12-bit PWM/Servo Driver
I'm pretty much out of ideas - Maybe try a different ground socket on the Pi? I think it has to be a grounding problem.
- mydnite
- Posts: 1
- Joined: Mon Dec 16, 2013 1:29 am
Re: Trouble with Adafruit 16-Channel 12-bit PWM/Servo Driver
This error message is a bit misleading as it could be the channel has been set incorrectly. My raspberry pi is all setup and working with four servos and while testing all four I inadvertently put in the wrong channel for pwm.setPWM(channel, 0, servoMin) and I got the error message "Error accessing 0x40: Check your I2C address". Check the channel out.
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/