Go Back   Home > Forums > Source & Line > Analog Line Level

Analog Line Level Preamplifiers , Passive Pre-amps, Crossovers, etc.

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 26th March 2013, 12:56 AM   #71
glt is offline glt  United States
diyAudio Member
 
Join Date: Oct 2004
Quote:
Originally Posted by maxw View Post
Yeah I've read that. I've used other I2C devices without issues but they were all 5V. This time I'm using one of these to change the level. Do I put the pull up resistors on the arduino to 5V or on the CS3318 side to 3.3V?
The board already has 10K pull ups. But you can use smaller pull ups if you wish. You need them on both sides.

Regarding your code:

Wire.beginTransmission(CSAddr); // Begin I2C
Wire.write(B10000000); // Chip Address and R/W bit
Wire.write(0x00); // select the register
Wire.write(0x99); // set register
Wire.endTransmission();


Wire.begin is for the chip address
Wire.write is to select the register address
The next write is for the value you want to write into the register
Wire.end sends the data and releases the bus

Try writing one register at a time.
__________________
www.hifiduino.wordpress.com
  Reply With Quote
Old 26th March 2013, 11:49 PM   #72
maxw is offline maxw  United Kingdom
diyAudio Member
 
maxw's Avatar
 
Join Date: Jun 2004
Location: London
Quote:
Originally Posted by counter culture View Post
Is that ALL the code?

...because it won't do anything. Unless there's something about Arduino C that is radically different from all the C I've ever come across.

You need a main() routine, and you need to call those routines...

int main(void)
{
setup();
loop();
}

Otherwise show us all of the code, it's impossible to debug fragmentary code.
Yes, that is all the code. I don't think there is a main() routine in the Arduino IDE.

Quote:
Originally Posted by glt View Post
The board already has 10K pull ups. But you can use smaller pull ups if you wish. You need them on both sides.

Regarding your code:

Wire.beginTransmission(CSAddr); // Begin I2C
Wire.write(B10000000); // Chip Address and R/W bit
Wire.write(0x00); // select the register
Wire.write(0x99); // set register
Wire.endTransmission();


Wire.begin is for the chip address
Wire.write is to select the register address
The next write is for the value you want to write into the register
Wire.end sends the data and releases the bus

Try writing one register at a time.
Thanks glt, this solved it. The first wire.write was not required. I put it in due to this being in the datasheet:
"The first byte sent to the CS3318 after a Start condition consists of a 7-bit chip address field and a R/W
bit", but I guess that part is taken care of in the Wire.beginTransmission.

Anyway, I got it going, then fried the chip. Not sure how but hey ho, learn as I go
  Reply With Quote
Old 26th March 2013, 11:56 PM   #73
diyAudio Member
 
Join Date: Jun 2011
Quote:
Originally Posted by maxw View Post
Yes, that is all the code. I don't think there is a main() routine in the Arduino IDE.
OK, thanks. I had a look at the Arduino programming language, I'll know in future.
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Digital Volume Contol - CS3318 - MAX5440 Ridin '24'z Digital Source 5 8th June 2011 01:36 PM
Sylonex and Arduino preamp oenboek Analog Line Level 17 12th March 2011 12:50 AM
Arduino for audio projects? glt Parts 5 9th March 2011 05:28 PM
Cooling fans with Arduino seahuston Chip Amps 10 23rd October 2010 05:58 AM
Can DIY audio be like Arduino glt Everything Else 1 3rd April 2009 03:57 PM


New To Site? Need Help?

All times are GMT. The time now is 07:25 PM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2