[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 - [SOLVED]Audio codec shield with Arduino Due

[SOLVED]Audio codec shield with Arduino Due

[SOLVED]Audio codec shield with Arduino Due

Postby youthreewire » Tue Jun 09, 2015 8:08 pm

Hello,

I am working with the audio codec shield. I want to port the library to Arduino Due.Could some one please guide me how to do it? After Due I want to port it to Intel Edison and even pcDuino3.

Thanks
Last edited by youthreewire on Thu Aug 06, 2015 10:47 am, edited 1 time in total.
youthreewire
 
Posts: 117
Joined: Tue Jun 09, 2015 8:06 pm

Re: Audio codec shield with Arduino Due

Postby guest » Tue Jun 09, 2015 8:45 pm

the codecshield requires I2C and I2S interfaces. so locate those pins for your microcontroller platform. from what ive heard, the I2S drivers arent written yet for the edison. the codecshield is hardwired as an I2S slave device, so you will also need a timer/counter clock input pin available. there are ways around this, but it involves modifying the PCB of the codecshield. the basic program flow is as follows:

1. set up registers via I2C
2. count clock cycles from codecshield
3. interrupt every N clock cycles to initiate an I2S data transfer
guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: Audio codec shield with Arduino Due

Postby youthreewire » Tue Jun 09, 2015 9:06 pm

I want to get this working first with the Due. I know that the I2C and SPI pins wont match the codec shield. So I have to manually wire it but is it possible to make the Library without using AVR specific code for the Due? I checked the library there is some ASM code and Timer specific code.So we have to change that and the rest is standard wire.h commands.
youthreewire
 
Posts: 117
Joined: Tue Jun 09, 2015 8:06 pm

Re: Audio codec shield with Arduino Due

Postby youthreewire » Tue Jun 09, 2015 9:08 pm

I tried running this on a Diecimilia and Maple but I want to stream the linein values over the serial port but the code appears to be crashing. Why can I not use Serial.print( ) functions with this library.Can the serial port issue be solved using a powerful microcontroller like the Due?
youthreewire
 
Posts: 117
Joined: Tue Jun 09, 2015 8:06 pm

Re: Audio codec shield with Arduino Due

Postby youthreewire » Tue Jun 09, 2015 9:14 pm

youthreewire
 
Posts: 117
Joined: Tue Jun 09, 2015 8:06 pm

Re: Audio codec shield with Arduino Due

Postby youthreewire » Tue Jun 09, 2015 9:37 pm

youthreewire
 
Posts: 117
Joined: Tue Jun 09, 2015 8:06 pm

Re: Audio codec shield with Arduino Due

Postby youthreewire » Tue Jun 09, 2015 9:39 pm

Looking at the code I think there are 12C(wire) and SPI pins being used. So what could be the connection diagram between the Due and the Shield?
youthreewire
 
Posts: 117
Joined: Tue Jun 09, 2015 8:06 pm

Re: Audio codec shield with Arduino Due

Postby guest » Wed Jun 10, 2015 10:56 am

on the maple, USB conflicts with SPI data transfers, so it cant be used (it can be used, but causes glitches). you can transfer over serial on an UNO, but it requires your own code, as the serial library is not optimized for speed. if you are trying to transfer data, you will need:

16b/sample * 2 sample (stereo) * 44ksamples/second = 1.4Mbps

since there is overhead in serial, you will probably need at least 2Mbps to actually make it work.

awesome that you found code that works! and its doing it over the SPI as well (usually SPI ports will double as I2S ports, so it might be I2S on the low level). so if you want to implement different code, you keep the data transfer the same as they have it shown. your incoming data is:

left = (temp_spi[0] << 8) | temp_spi[1];
right = (temp_spi[2] << 8) | temp_spi[3];

so to do delay, you just make a buffer, and load those data in, and take the data out from a different address. the rest of the example code should stay the same.
guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: Audio codec shield with Arduino Due

Postby youthreewire » Wed Jun 10, 2015 9:39 pm

Now I have two microcontrollers on that works at 16 Mhz works at 2.5Mbaud and other at 84Mhz but works only at 1Mbaud. So which one should I use here? But I am assuming the codec shield will work better with the 84Mhz device as it has more RAM .
youthreewire
 
Posts: 117
Joined: Tue Jun 09, 2015 8:06 pm

Re: Audio codec shield with Arduino Due

Postby youthreewire » Thu Jun 11, 2015 3:37 am

I ran this code but it crashes .I cant get the serial port to work with this program.I put anything to print the program crashes. If I disable the timer function in the setup then it prints otherwise it crashes. Could some one help me out here.
youthreewire
 
Posts: 117
Joined: Tue Jun 09, 2015 8:06 pm

Next

Return to Audio Codec Shield

Who is online

Users browsing this forum: No registered users and 0 guests


cron