I'm facing a problem with the 16 channel servo driver (https://www.adafruit.com/product/815) and my Raspberry Pi (B, 512Mb), I'd like to document everything so you may figure where the problem is and how to debug it. Let's start with the OS: Raspbian (2015-04), here's the system:
Code: Select all
root@pi:~# i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: 40 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: 70 -- -- -- -- -- -- --
root@pi:~# lsmod
Module Size Used by
i2c_dev 6709 0
snd_bcm2835 21342 0
snd_pcm 93100 1 snd_bcm2835
snd_seq 61097 0
snd_seq_device 7209 1 snd_seq
snd_timer 23007 2 snd_pcm,snd_seq
snd 67211 5 snd_bcm2835,snd_timer,snd_pcm,snd_seq,snd_seq_device
i2c_bcm2708 6200 0
uio_pdrv_genirq 3666 0
uio 9897 1 uio_pdrv_genirq
As described from learning section (https://learn.adafruit.com/adafruit-16- ... spberry-pi) I have downloaded the source code from github (https://github.com/adafruit/Adafruit-Ra ... ython-Code) and in Servo_Example.py I have modified
Code: Select all
pwm = PWM(0x40)
Code: Select all
pwm = PWM(0x40, debug=True)
I don't have a capacitor because I'm using just one PWM motor for testing purposes, it's connected on port 0 (as tutorial suggests) and is an Hossen SG90 9g Servo (http://www.amazon.com/gp/product/B00CCZ ... UTF8&psc=1).
On your board I can see the power led on and it seems to be communicating the the Pi.... but the motor never moves.
What am I missing ?
Thank you in advance for your reply
Ben
Here's the output of the python program
Code: Select all
root@pi:~/pwm/Adafruit-Raspberry-Pi-Python-Code/Adafruit_PWM_Servo_Driver# python Servo_Example.py
Reseting PCA9685 MODE1 (without SLEEP) and MODE2
I2C: Wrote 0x00 to register 0xFA
I2C: Wrote 0x00 to register 0xFB
I2C: Wrote 0x00 to register 0xFC
I2C: Wrote 0x00 to register 0xFD
I2C: Wrote 0x04 to register 0x01
I2C: Wrote 0x01 to register 0x00
I2C: Device 0x40 returned 0x01 from reg 0x00
I2C: Wrote 0x01 to register 0x00
Setting PWM frequency to 60 Hz
Estimated pre-scale: 100
Final pre-scale: 101
I2C: Device 0x40 returned 0x01 from reg 0x00
I2C: Wrote 0x11 to register 0x00
I2C: Wrote 0x65 to register 0xFE
I2C: Wrote 0x01 to register 0x00
I2C: Wrote 0x81 to register 0x00
I2C: Wrote 0x00 to register 0x06
I2C: Wrote 0x00 to register 0x07
I2C: Wrote 0x96 to register 0x08
I2C: Wrote 0x00 to register 0x09
I2C: Wrote 0x00 to register 0x06
I2C: Wrote 0x00 to register 0x07
I2C: Wrote 0x58 to register 0x08
I2C: Wrote 0x02 to register 0x09
I2C: Wrote 0x00 to register 0x06
I2C: Wrote 0x00 to register 0x07
I2C: Wrote 0x96 to register 0x08
I2C: Wrote 0x00 to register 0x09
I2C: Wrote 0x00 to register 0x06
I2C: Wrote 0x00 to register 0x07
I2C: Wrote 0x58 to register 0x08
I2C: Wrote 0x02 to register 0x09
I2C: Wrote 0x00 to register 0x06
I2C: Wrote 0x00 to register 0x07
I2C: Wrote 0x96 to register 0x08
I2C: Wrote 0x00 to register 0x09
^CTraceback (most recent call last):
File "Servo_Example.py", line 32, in <module>
time.sleep(1)
KeyboardInterrupt