[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4756: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4758: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4759: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4760: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
Open Music Labs Forums • View topic - Using with Arduino Mega 2560

Using with Arduino Mega 2560

Using with Arduino Mega 2560

Postby chipaudette » Fri Jan 27, 2012 8:26 am

Hi All,

I received my Audio Code Shield a couple weeks ago. I'm now hooking it up to an Arduino Mega 2560. I downloaded the AudioCodec library for Arduino 1.0 and I'm using the Arduino 1.0 IDE (and yes, the IDE is set to Arduino Mega 2560). I compiled and uploaded sine_generator example program. I'm trying to listen to the line out (via a head phone amplifier). I'm getting nothing. I manipulate the knobs and I get nothing. No sound.

Bummer.

So, I begin to debug the code by starting a Serial link and using Serial.println commands to see what's happening. I created a counting variable (volatile long int defined as a global) and made it increment in the ISR each time the ISR is called. In the main loop, inside the while loop, I put my Serial.println(counter).

When I compile and run, the counter value stays at zero. It never increments. Bummer.

Is there something special about the Mega 2560 that is preventing this from running. Does anyone have any suggestions?

Thanks,

Chip
chipaudette
 
Posts: 5
Joined: Fri Jan 27, 2012 8:14 am

Re: Using with Arduino Mega 2560

Postby guest » Fri Jan 27, 2012 9:19 am

the arduino mega has a different pinout for its spi buss
in comparison to the uno and duemilinove
so some hacking is required to make them work together

we updated the website to reflect this a week or so ago

if youre interested in trying to hack them to work together
i can help out with information and code
guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: Using with Arduino Mega 2560

Postby chipaudette » Tue Jan 31, 2012 10:23 am

Thanks for the pointer about the SPI bus. Bummer. I can figure out the hack. It's just unfortunate that the hack will mess up the clean form factor of the shield. Flying leads over to the Mega's 50's pins is just unsightly. Bummer that the Arduino folks chose to wire the Mega differently from the Uno.

Chip
chipaudette
 
Posts: 5
Joined: Fri Jan 27, 2012 8:14 am

Re: Using with Arduino Mega 2560

Postby guest » Tue Jan 31, 2012 1:36 pm

yeah
im not sure why they did it that way
we were pretty bummed too when we realized it

then we took a look at the price point between the mega and the maple
and figured the maple would be a better high end platform anyways
guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: Using with Arduino Mega 2560

Postby guest » Sat Jul 21, 2012 1:29 pm

guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: Using with Arduino Mega 2560

Postby scott2 » Thu Nov 01, 2012 4:56 pm

scott2
 
Posts: 15
Joined: Thu Sep 27, 2012 5:48 pm

Re: Using with Arduino Mega 2560

Postby scott2 » Fri Nov 02, 2012 10:06 am

Found some errors:
- TIMSK0 = 0x00 > TIMSK5 = 0x00;

And then corrected for ISR(TIMER0_COMPA_vect, ISR_NAKED) > ISR(TIMER5_COMPA_vect, ISR_NAKED) in the demo code.

Still no luck, though
scott2
 
Posts: 15
Joined: Thu Sep 27, 2012 5:48 pm

Re: Using with Arduino Mega 2560

Postby guest » Fri Nov 02, 2012 10:49 am

the TIMSK0 is actually to turn off the delay() timer, so that is correct.
if you change that line back, the TIMER5 interrupt will work.

do you have an oscilloscope? if not, measure the dc voltage on the various I2C, SPI, and clock lines, to see if they are being toggled. if they are anything but 0V or 5V, then there is data going across them.

i will dig through the rest of the code to see if there are other bits missing.
guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: Using with Arduino Mega 2560

Postby guest » Fri Nov 02, 2012 10:57 am

Last edited by guest on Fri Nov 02, 2012 11:03 am, edited 1 time in total.
guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: Using with Arduino Mega 2560

Postby guest » Fri Nov 02, 2012 11:00 am

guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Next

Return to Audio Codec Shield

Who is online

Users browsing this forum: No registered users and 3 guests


cron