Pages: [1]   Go Down
Author Topic: I2C volume control  (Read 2182 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

I've bought a 2 channel volume control chip called M62429P. Actual it is just a digital potentiometer with two channels. The component has been attached to my Arduino UNO board and I am trying to control the volume using the "Wire" library.

The components datasheet can be found here:
http://www.datasheetcatalog.org/datasheet/MitsubishiElectricCorporation/mXtyrzs.pdf

I have been trying to send the 11 bits in two bytes via the Wire.write(byte) command, but with no luck.
Also I am not sure of the direction of the bits.

Can anyone help me with a command for sending e.g 0db, -43db and -∞db

Thanks!
Logged

Portugal
Offline Offline
Edison Member
*
Karma: 37
Posts: 1579
Pretending you know everything then you will learn nothing.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

From what I seen in the datasheet it's seems to be easy.
Are you connecting the I2C lines in the right pins?
Quote
Uno A4 (SDA), A5 (SCL)
Code:
byte val[10] = {0x01 .........};//all the elements you want to send
void setup()
{
 Wire.begin(); // join i2c bus
}

void loop()
{
  Wire.beginTransmission();                           
  Wire.write(val,11);             // fill data buffer to be transmited-> 11 bytes
  Wire.endTransmission();     // stop transmitting
Logged

Debian,Mint,Ubuntu
Arduino Mega 2560
Arduino Nano
Arduino Duemilanove
MAC OS Montain Lion
Raspberry PI Model B


Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the quick reply.

The pins are connected correctly. It sounds easy but I really can not get it working... :/

The function beginTransmission(byte) takes one argument - the address, which I can't find in the data sheet and can not be set using e.g. short-circuit on the IC.

You are sending 11 bytes. Shouldn't it be bits?
I am thinking something like 0b00101011111 for 0db or 0b11111010100 if the bits are ordered in reverse.
Logged

Portugal
Offline Offline
Edison Member
*
Karma: 37
Posts: 1579
Pretending you know everything then you will learn nothing.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
You are sending 11 bytes. Shouldn't it be bits?
Yes my mistake.You are right  smiley-mr-green
Logged

Debian,Mint,Ubuntu
Arduino Mega 2560
Arduino Nano
Arduino Duemilanove
MAC OS Montain Lion
Raspberry PI Model B


Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Do I need to use begin- and endTransmission when I have no address to put as argument?

I've tried to split the data into two bytes but with no luck. Do you have any suggestions?

Thanks
Logged

Germany
Offline Offline
Jr. Member
**
Karma: 0
Posts: 76
just sun
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi christianlykke,

hm the datasheet is not so clear -
you can try to use the i2c_scanner
there is another I2C Scanner out there.
as fare as i know normaly you have to use the begin and end Transmission funcitons.
otherweise the i2c or TWI will not work.
you can also check the return of the Wire.endTransmission() :
Quote
Returns

byte, which indicates the status of the transmission:

    0:success
    1:data too long to fit in transmit buffer
    2:received NACK on transmit of address
    3:received NACK on transmit of data
    4:other error

for your chip are not much infos available..
pleas report back if you found something out.

sunny greetings stefan
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Stefan

Thanks for your reply.

Good idea scanning for the address. But unfortunately the scanner finds no I2C components.

I've tried attaching another I2C component which works perfectly so I am pretty sure the component is attached correctly.

I am running out of ideas :/

Christian
« Last Edit: April 24, 2013, 02:54:35 am by christianlykke » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Christian,

Did you ever get this chip working?  Seems the data is to be clocked in raw, bit by bit, similar to SPI (can test this with a loop and two pins).

I was recently looking for a digital potentiometer for a project and this came to my attention, unfortunately information on it (and it's behavior) is quite sparse...

Best regards,
Jamil
Logged

Pages: [1]   Go Up
Jump to: