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:
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
From what I seen in the datasheet it's seems to be easy.
Are you connecting the I2C lines in the right pins?
Uno A4 (SDA), A5 (SCL)
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
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.
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() :
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.
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...