My Woes - Digital i2c Control of 20W MAX 9744 Amplifier

Our weekly LIVE video chat. Every Wednesday at 8pm ET!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
jayagopal108
 
Posts: 2
Joined: Sun Apr 17, 2016 11:32 pm

My Woes - Digital i2c Control of 20W MAX 9744 Amplifier

Post by jayagopal108 »

Well hello!

I can't control the volume of this awesome little amplifier via python on my Raspberry Pi3. Would one of you help?

After about 8 solid hours of rechecking my soldering work, testing voltages, following the tutorials for enabling i2c, and following the tutorials for installing https://github.com/adafruit/Adafruit_Python_MAX9744, I have realized I have no idea how to proceed anymore. Did I break something while soldering? Did I install something incorrectly?

First: I'm so impressed with the amazing tutorials, libraries and examples by Adafruit!

* I'm using python3.4
* I'm using Raspian
* The project board is a Raspberry Pi 3
* Playing sound via python3 works great through the amplifier. But I can't control the volume :/
* I've installed python-smbus as well as python3-smbus

* These are my connections:

Code: Select all

     RPi3_02(SDA1)    ---> MAX9744_SDA
     RPi3_03(SCL1)    ---> MAX9744_SCL
     RPi3_17(3.3v DC) ---> MAX9744_Vi2c
     RPi3_20(Ground)  ---> MAX9744_GND
* Here is the result of i2cdetect - y 1 (as well as sudo gpio i2cd):

Code: Select all

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --
* Here is what running simpletest.py from the Adafruit_MAX9744 library yields:

Code: Select all

>>> ================================ RESTART ================================
>>>
Setting volume to 32 for 5 seconds...
Traceback (most recent call last):
File "/home/pi/Desktop/simpletest.py", line 30, in
amp.set_volume(MAX_VOLUME)
File "/usr/local/lib/python3.4/dist-packages/Adafruit_MAX9744-1.0.1-py3.4.egg/Adafruit_MAX9744/MAX9744.py", line 49, in set_volume
self._device.writeRaw8(value & 0b111111)
File "/usr/local/lib/python3.4/dist-packages/Adafruit_GPIO-0.9.3-py3.4.egg/Adafruit_GPIO/I2C.py", line 102, in writeRaw8
self._bus.write_byte(self._address, value)
TimeoutError: [Errno 110] Connection timed out
>>> 
* Here are the contents of /boot/config.txt (I've omitted anything #'d):

Code: Select all

disable_overscan=1
hdmi_force_hotplug=1
hdmi_group=2
hdmi_mode=1
hdmi_mode=87
hdmi_cvt=800 480 60 6 0 0 0
max_usb_current=1
dtoverlay=w1-gpio
dtparam=audio=on
dtparam=i2c_arm=on
dtparam=i2c1=on
* Here are the contents of /etc/modules:

Code: Select all

snd-bcm2835
i2c-bcm2708
i2c-dev
* Here are the contents of /etc/modprobe.d/raspi_blacklist.conf and /etc/modprobe.d/raspi-blacklist.conf (both for good measure? They didn't exist at first):

Code: Select all

#blacklist spi-bcm2708
#blacklist i2c-bcm2708
* Pictures! WOO!!!
Purple: SDA
Gray: SCL
Orange: 3.3v
Green: Ground
Image

Purple: SDA
Gray: SCL
Orange: 3.3v
Green: Ground
Image

The only really funky soldering point is on the 5v-14v DC terminal block... which is working fine :)
Image

.
.
.
Thank you so much for making it this far! Here's a picture of raspberry colored potatoes for you:
Image

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: My Woes - Digital i2c Control of 20W MAX 9744 Amplifier

Post by adafruit_support_rick »

I'd start by going over your solders again. The solder hasn't flowed completely over the pads on many of them. You need to heat both the pad and the pin together before applying solder. A good solder joint looks like this:
Image

The solder flows completely over the pad and up the pin.

User avatar
chrisw63
 
Posts: 34
Joined: Thu Nov 07, 2013 5:39 pm

Re: My Woes - Digital i2c Control of 20W MAX 9744 Amplifier

Post by chrisw63 »

So you're getting a Timeout Error when you try to run the code? That's not supposed to happen. I2C itself doesn't Have timeouts. Is the code trying to read a status from the MAX chip and not getting a response?

A quick look at the Adafruit page for the MAX9744, the big red background text caught my eye: "Make sure the AD1 AD2 and Analog solder jumpers are not closed before running the I2C tests, or it won't work! For digital mode, these jumpers must be un-soldered". I truly hope your problem is that easy of a fix.

Other than that, check if the chip is getting power and that its 5v (I know, you've probably checked a hundred times), and recheck connections. Have someone else check them too - its easy to get a little myopic when working on a project for a long time. After that, its 'scope city. I know oscilloscopes are expensive - I certainly can't afford one. If you don't have one either, ask around to try and borrow one, or maybe someone can check the signal lines for you. You'll need at least two inputs - one for the clock and one for the data. Check that the Clock line is fully at the correct level and timing compared to the data. If its a storage scope you can then check to see if the data is correct as well.

Best of luck to you - and I know I'd be interested in the solution if you're willing to post it.

Chris W.
Charleston SC

User avatar
jayagopal108
 
Posts: 2
Joined: Sun Apr 17, 2016 11:32 pm

Re: My Woes - Digital i2c Control of 20W MAX 9744 Amplifier

Post by jayagopal108 »

It's working!
Thank you @adafruit_support_rick. that's good advice, but it turns out it wasn't a soldering issue.

And Thank you @chrisw63 for your thorough reply. An oscilloscope probably would have ended up helping me find the issue. I'm not sure what the issue was, and I can't get it to do it again, but I think there was some unwanted voltage across one of the data wires preventing a sufficiently low signal for logic. Could that have been from resonating with a speaker wire? Another wire? A weird grounding situation?

But it does work beautifully now, and I can't manage to get the timeout error back. Also, the timeout error was instant before, FYI.

Take care, all :)

User avatar
lbseale
 
Posts: 2
Joined: Tue May 24, 2016 7:55 pm

Re: My Woes - Digital i2c Control of 20W MAX 9744 Amplifier

Post by lbseale »

Hello,

I am also having issues with communicating with the MAX9744 via I2C. I'm a teacher working with a student on this. It seems like we have more than one problem, and we'd appreciate help with both.

The first is this: we are unable to successfully write the volume using the example code. We connected it to an oscilloscope, and I've attached what we got. Yellow is SDA, blue is SCL. I thought the clock signal looked ragged and not very good. I also saw that the last bit, before the STOP condition, was a 1. From reading the MAX9744 datasheet, I learned that means the chip is not acknowledging the write request. Obviously there are no bits written after that, so we are not writing the volume.

The second problem doesn't seem to be related, but maybe it is. When we plug 12V into the MAX9744, the SDA line goes to 0.5v. (In the picture, the SCL line probe is not connected to anything). When we try to write the volume, nothing happens at all.

We would really appreciate any help with this. Thank you.

Pictures: http://imgur.com/a/aHhYI

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: My Woes - Digital i2c Control of 20W MAX 9744 Amplifier

Post by adafruit_support_rick »

Please post a picture of your soldering.

SDA and SCL are open collector. The voltage will float unless you have pullup resistors connected. Arduinos have pullup resistors built-in, so you should see that behavior disappear when SDA and SCL are connected to the Arduino.

User avatar
lbseale
 
Posts: 2
Joined: Tue May 24, 2016 7:55 pm

Re: My Woes - Digital i2c Control of 20W MAX 9744 Amplifier

Post by lbseale »

Hi Rick,

Here is our wiring scheme. From MAX9744 to Arduino Uno:
http://imgur.com/a/Uliba

SDA is wired to A5
SCL is wired to A4
Vi2c is wired to 5V
GND is wired to GND

Thank you,
Luke.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: My Woes - Digital i2c Control of 20W MAX 9744 Amplifier

Post by adafruit_support_rick »

lbseale wrote:SDA is wired to A5
SCL is wired to A4
Should be the other way around. SDA is A4 and SCL is A5. Is this what you have? Can't quite tell for sure from the picture

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

Return to “Ask an Engineer! VIDEO CHAT (closed)”