spi and i2c

spi and i2c

Postby ajtaji » Wed Jan 29, 2014 5:53 am

I did a brief examination of the data sheet for this codec. I noticed it has a built in crystal but your shield uses an external? Why? Also the data sheet says the control lines are spi compatible but you wrote another routine to communicate with the arduino. What was the exact purpose of this? Why cant the standard spi library be set up to communicate with this chip. Finally you are using i2c also, I'm totally lost on this one? I bought this board, it came with no instruction manual, nor does the wiki explain why this was done over that, etc... back in the 80's you bought something it came with more information than you wanted, today is becoming a joke
ajtaji
 
Posts: 3
Joined: Wed Jan 29, 2014 5:43 am

Re: spi and i2c

Postby guest » Wed Jan 29, 2014 3:07 pm

1. there is no internal oscillator/crystal on the codec.
2. the control lines are SPI compatible. but the SPI is used for the data lines, which are not SPI compatible, and needed to be hacked to work with the codec.
3. the I2C is used for the control ines.

the codec has 2 serial lines - control and data. the control sets up the parameters, and the data passes the audio information.

as someone who bought a lot of kits in the 80's, i would argue that you get way more information these days with DIY products. gerber files? eagle files? BOMs with manufacturer part numbers? forums to ask questions on? for the actual solder-it-yourself kits, most suppliers have detailed webpages with videos and pictures documenting each step. i remember getting a pcb, some parts, and a list of what went where. it would be helpful to include a list of design decisions with a finalized design, and some within the open hardware community have been trying to standardize ways of doing this, but for the designer it is quite time consuming to document why each component/trace/piece of code is was chosen. within the header files for a lot of code you will find some of this.
guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: spi and i2c

Postby ajtaji » Wed Jan 29, 2014 7:00 pm

Thank you for that brief explanation...I knew there was a reason for it...now to dig more... I also bought sram and fpu which uses spi, thought there might have been some issue with spi itself
ajtaji
 
Posts: 3
Joined: Wed Jan 29, 2014 5:43 am

Re: spi and i2c

Postby guest » Thu Jan 30, 2014 5:46 am

which platform are you going to be using it with? some microcontrollers have 2 or more SPI lines. also, the UART on the arduino can be put into SPI mode (although this means no more USB). the SPI bus can also, IN THEORY, be multiplexed on the codec shield board, but i have never tried this. there is an enable line for the level translator.
guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: spi and i2c

Postby ajtaji » Fri Jan 31, 2014 6:53 pm

Arduino Due and Uno, although the Uno I might have to breadboard the 328 and run it at 20mhz, I wont be doing anything for a while, lots of planning and research first, these are both new platforms for me...
ajtaji
 
Posts: 3
Joined: Wed Jan 29, 2014 5:43 am

Re: spi and i2c

Postby guest » Sat Feb 01, 2014 5:04 pm

ok, the due came out after we designed the codecshield, so it does not work out of the box with it. the SPI hack needs to be rewritten for the due, although the due probably has i2s on it, and that would be preferable to use.
guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: spi and i2c

Postby liner » Wed Apr 30, 2014 9:39 am

I am currently using the Audio codec shield with an Arduino UNO without problems but I would like to use the Arduino to control another device that also uses SPI. I am afraid there might be some conflict between the two devices. Could you give some explanation on how to do this? Thank you.
liner
 
Posts: 6
Joined: Fri Jun 29, 2012 2:11 am

Re: spi and i2c

Postby guest » Wed Apr 30, 2014 11:53 am

there is a buffer between the spi out on the uno, and the spi in on the codec. so in theory, the lines can be disengaged, and the data sent elsewhere. but, the codec needs to recieve its spi data at very precise intervals (within 250ns!) so the other device can not block it. if its an SD card, it will be really difficult to set it up so its non-blocking. what is the other device?
guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: spi and i2c

Postby liner » Wed May 14, 2014 6:06 am

Hi,

Thank you for your answer. I ended up using another digital pin for the other device and setting the same clock on both devices. It seems to be working.
liner
 
Posts: 6
Joined: Fri Jun 29, 2012 2:11 am

Re: spi and i2c

Postby guest » Wed May 14, 2014 4:11 pm

glad to hear its working. if youre using the same clock for both SPI devices, how are you changing the data on the data line for the other one?
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 1 guest


cron