DSD1794 + i2c

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Hello.
I have a few questions about i2c protocol.
i read datasheet and can`t understand how it use.

datasheet write Register 16 = that mean 0x10 ? (reg 17 = 0x11?)
than all registers are 16 bits.

We need send 8bit (b0 b1 b2 ...) + 8 bit (b8 b9 b10...) ?
auto increment ?

Thanks for help
 
Hello.
I have a few questions about i2c protocol.
i read datasheet and can`t understand how it use.

datasheet write Register 16 = that mean 0x10 ? (reg 17 = 0x11?)
than all registers are 16 bits.

We need send 8bit (b0 b1 b2 ...) + 8 bit (b8 b9 b10...) ?
auto increment ?

Thanks for help

The Datasheet is quite confusing. It looks as though there are only a few registers that control a lot of functions at the same time. For example to set the filter you need to change bit 1 of register 19, 0 will set it to sharp 1 will set it to slow.

16 in hex is 0x10 and 17 is 0x11 so you have that correct. The registers do contain 16 bits so you will have to send them if you want to control the registers. The Datasheet shows which bits are LSB and MSB this should let you know how to organise the data into two bytes so they are read in the correct order.

If you are using an arduino or similar the wire library uses 7 bit i2c addresses and the 8th bit R/W is automatically added. The i2c address for the chip is determined by the ADDR 0 and 1 pins together with the other bits that have already been defined in the slave address protocol of the datasheet.

I would start by seeing if you can read the data from a register and print the value. They should be in their default condition so you should be able to tell if the value is the same as what you were expecting.

https://downloadcode.wordpress.com/2010/11/07/code-for-buffalo-ii-dac-v-b04/

This link is the oldest (simplest) code from hifiduino that actually wrote to the register addresses, this should help you to understand how glt did it. The sabre DAC only uses single byte registers so there will be some differences.

I have no experience with the DAC you have but that is what I got from looking at the datasheet.
 
thanks for your help.

I find some code on this forum.
(http://www.diyaudio.com/forums/digi...allel-dsd1794-nos-capable-dsd-pcm-source.html)

void SetPCMReg()
{
Wire.beginTransmission(0x4c); //slave address
WritePCMReg(); // go to send bits
Wire.endTransmission();
}

void WritePCMReg()
{
Wire.write(B00010010); // reg 18?
Wire.write(B00100000); //
Wire.write(B00000001); // why send 24 bits ?
Wire.write(B00011100); //
}

I write coments. who can help to understand code?

and this one

Wire.beginTransmission(0x4c); //slave address
Wire.write(B10010000); // reg address? why it 0x90???
Wire.endTransmission();
Wire.requestFrom(0x4c,7); //request 7 bytes. Why 7 if 1 register is 16bit?
 
Last edited:
Code:
void SetPCMReg()
{
Wire.beginTransmission(0x4c); //slave address 
WritePCMReg(); // go to send bits
Wire.endTransmission();
}

This declares the function SetPCMReg

That function transmits on the i2c bus to the slave address 0x4c and sends WritePCMReg

Code:
void WritePCMReg()
{
Wire.write(B00010010); // reg 18?
Wire.write(B00100000); //
Wire.write(B00000001); // why send 24 bits ? 
Wire.write(B00011100); //
}

This is then sending 4 bytes as binary rather than hex or decimal. Normally you would send the register first and then the value.


Code:
Wire.beginTransmission(0x4c); //slave address
Wire.write(B10010000); // reg address? why it 0x90???
Wire.endTransmission(); 
Wire.requestFrom(0x4c,7); //request 7 bytes. Why 7 if 1 register is 16bit?

The address is 0x4c and it is writing B10010000 which is 90 in hex but is likely only writing to change half of the register values.

Maybe send a pm to the user who posted that code. There is very little explanation in comments so it makes it hard to know exactly what they were doing.
 

i mean

Code:
void SetPCMReg()
{
Wire.beginTransmission(0x4c); //slave address 
Wire.write(B00010010); // reg 18?
Wire.write(B00100000); //
Wire.write(B00000001); // why send 24 bits ? 
Wire.write(B00011100); //
Wire.endTransmission();
}

slave address + reg address + data to registers

and in code he send 24 bits data. But registers are 16bits.
 
Thanks a lot for help.

i write to 2A3SET. And he told me about registers.
B15 ~ B8 = this is the address.
But i think it's a part of data that i need to send every time.
 

Attachments

  • 3332.png
    3332.png
    37 KB · Views: 157
That would make more sense that the extra byte is the actual register address.
There are two ways to write data in single access and multiple access. The datasheet is a little confusing to me in how this is described.

Screen Shot 2016-12-18 at 8.40.31 am.png

Without comments in the code it is hard to know which function is being written to so I think you will need to ask more specific questions to 2A3 if you want to adapt that code rather than just use it as is.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.