Go Back   Home > Forums > >
Home Forums Rules Articles diyAudio Store Blogs Gallery Wiki Register Donations FAQ Calendar Search Today's Posts Mark Forums Read

Digital Line Level DACs, Digital Crossovers, Equalizers, etc.

DSD1794 + i2c
DSD1794 + i2c
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 16th December 2016, 04:01 PM   #1
r0cket111 is offline r0cket111
diyAudio Member
 
Join Date: Dec 2016
Default DSD1794 + i2c

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
  Reply With Quote
Old 17th December 2016, 05:49 AM   #2
fluid is offline fluid  Australia
diyAudio Member
 
Join Date: Jan 2009
Quote:
Originally Posted by r0cket111 View Post
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/2...-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.
  Reply With Quote
Old 17th December 2016, 06:38 AM   #3
r0cket111 is offline r0cket111
diyAudio Member
 
Join Date: Dec 2016
thanks for your help.

I find some code on this forum.
(Parallel DSD1794 NOS capable of DSD and PCM source)

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 by r0cket111; 17th December 2016 at 06:49 AM.
  Reply With Quote
Old 17th December 2016, 12:24 PM   #4
fluid is offline fluid  Australia
diyAudio Member
 
Join Date: Jan 2009
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.
  Reply With Quote
Old 17th December 2016, 12:30 PM   #5
r0cket111 is offline r0cket111
diyAudio Member
 
Join Date: Dec 2016
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.
  Reply With Quote
Old 17th December 2016, 03:18 PM   #6
r0cket111 is offline r0cket111
diyAudio Member
 
Join Date: Dec 2016
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.
Attached Images
File Type: png 3332.png (37.0 KB, 83 views)
  Reply With Quote
Old 17th December 2016, 11:45 PM   #7
fluid is offline fluid  Australia
diyAudio Member
 
Join Date: Jan 2009
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.
  Reply With Quote

Reply


DSD1794 + i2cHide 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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Parallel DSD1794 NOS capable of DSD and PCM source morpheous87 Digital Line Level 7 25th June 2015 03:47 PM
Parallel DSD1794 NOS capable of DSD and PCM source morpheous87 Digital Source 0 19th March 2015 05:53 PM
Parallel DSD1794 NOS/DSD passive I/V 2A3SET Digital Source 5 2nd October 2014 09:48 PM
I2c Amdio Digital Source 9 29th April 2007 12:05 AM
How to isolate I2C Popolvár Digital Source 3 11th June 2003 03:54 PM


New To Site? Need Help?

All times are GMT. The time now is 02:09 AM.


Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 14.29%
vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
Copyright ©1999-2019 diyAudio
Wiki