Due to high demand expect some shipping delays at this time, orders may not ship for 3-4 business days. On MLK Day no orders will be shipped.
0

Wave Shield Distortion
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: Wave Shield Distortion

by soerena on Sun Jul 28, 2013 6:52 am

actually, if you look closer at my playComplete, I have removed the while(1){} in order for it to be able to check for other buttons.

so this could actually be the problem? that the arduino is doing other stuff while playing?? wow this is getting interesting

soerena
 
Posts: 57
Joined: Fri Nov 16, 2012 7:00 am

Re: Wave Shield Distortion

by soerena on Sun Jul 28, 2013 6:57 am

i just tried putting back the while(1), and now there's no distortion!! wauw!

So I need to find some kind of work-around, for it to listen for other buttons without distorting while playing.. any ideas?

soerena
 
Posts: 57
Joined: Fri Nov 16, 2012 7:00 am

Re: Wave Shield Distortion

by adafruit_support_bill on Sun Jul 28, 2013 6:58 am

The playback is interrupt-driven, so normal program execution should not affect it. However, it is possible that the i2c communication disables interrupts long enough to disrupt the timing.

adafruit_support_bill
 
Posts: 82799
Joined: Sat Feb 07, 2009 10:11 am

Re: Wave Shield Distortion

by soerena on Sun Jul 28, 2013 7:26 am

OK, so it seems to be the I2C read that I'm doing that causes the distortion. A few delays for debouncing doesn't affect the sound.

soerena
 
Posts: 57
Joined: Fri Nov 16, 2012 7:00 am

Re: Wave Shield Distortion

by adafruit_support_bill on Sun Jul 28, 2013 7:27 am

Delays should be fine. The delay function does not disable interrupts.

adafruit_support_bill
 
Posts: 82799
Joined: Sat Feb 07, 2009 10:11 am

Re: Wave Shield Distortion

by soerena on Sun Jul 28, 2013 7:30 am

So reading an I2C device disables interrupts, but writing doesn't?
Because I'm writing without any audible issues, but as soon as I start reading there's distortion.

soerena
 
Posts: 57
Joined: Fri Nov 16, 2012 7:00 am

Re: Wave Shield Distortion

by adafruit_support_bill on Sun Jul 28, 2013 7:40 am

Writing does not need to use interrupts. The writer is in control of the bus and does not need to respond to asynchronously received data.

adafruit_support_bill
 
Posts: 82799
Joined: Sat Feb 07, 2009 10:11 am

Re: Wave Shield Distortion

by soerena on Sun Jul 28, 2013 7:45 am

Thanks Bill! That cleared up some stuff.

So now that I can't use the I2C for reading, I guess I'll have to make a resistor ladder on my device nr 2 as well since I only have 11 available IO's on the board.
Are there any work-arounds, alternatives or is this really what I have to do? If so, then I'm in a hell of a hurry to rearrange my circuit and everything.

soerena
 
Posts: 57
Joined: Fri Nov 16, 2012 7:00 am

Re: Wave Shield Distortion

by adafruit_support_bill on Sun Jul 28, 2013 9:13 am

Options I can see are:

adafruit_support_bill
 
Posts: 82799
Joined: Sat Feb 07, 2009 10:11 am

Please be positive and constructive with your questions and comments.