- It is currently Thu Jun 30, 2022 7:02 am • All times are UTC - 8 hours [ DST ]
spi and i2c
13 posts
• Page 1 of 2 • 1, 2
spi and i2c
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
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.
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
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
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
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
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
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
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
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.
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
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
13 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 1 guest