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

Twisted Pear Superior quality electronic kits

Reply
 
Thread Tools Search this Thread
Old 8th January 2020, 08:15 PM   #11
drone is offline drone  Germany
diyAudio Member
 
Join Date: Jan 2006
Location: Germany Rheinarea
Hello,
thank you again for helping. Even more for your time!

Branko
  Reply With Quote
Old 24th February 2020, 10:05 PM   #12
drone is offline drone  Germany
diyAudio Member
 
Join Date: Jan 2006
Location: Germany Rheinarea
Hello,

had some time on weekend and tried to get further:

the code from Dimitris (dimdim) v. 2.13 is for ES9018. The version for ES9038pro is v. 1.09 pro. this use different registers for reading the dpll values.

Also I would need how to tell what signal type is playing (DOD; DSD; PCM and Spdif or I2S) for the calculations. How do I get this info with your code?

Thank you

Branko

Here is the Sampling Rate part of dimdim ES9038 code (hope this is OK?):

// ----------------------------- Function to determine Sampling Rate
/* sig_type:
* 0 = DOP
* 1 = SPDIF
* 2 = I2S
* 3 = DSD
*/
void getSR()
{
volatile unsigned long DPLLNum; // Variable to hold DPLL value
volatile unsigned long RegVal; // Variable to hold Register values

DPLLNum=0;
// Reading the 4 registers of DPLL one byte at a time and stuffing into a single 32-bit number
DPLLNum|=ReadRegister(dac, 0x45);
DPLLNum<<=8;
DPLLNum|=ReadRegister(dac, 0x44);
DPLLNum<<=8;
DPLLNum|=ReadRegister(dac, 0x43);
DPLLNum<<=8;
DPLLNum|=ReadRegister(dac, 0x42);

SerialUSB.print(F("Raw DPLL number: ")); SerialUSB.println(DPLLNum);

/*
if (sig_type == 1)
{
DPLLNum*=20; // Calculate SR for SPDIF
DPLLNum/=859; // Calculate SR for SDPIF
}
else
{ // Different calculation for SPDIF and I2S/DSD
DPLLNum*=4; // Calculate SR for I2S/DSD
DPLLNum/=10995; // Calculate SR for I2S/DSD
}
*/

long sampleRate = 0;
sampleRate=(DPLLNum*MCLK)/42940;

SerialUSB.print(F("Sample Rate: ")); SerialUSB.println(sampleRate);

if (DPLLNum < 90000) // Adjusting because in integer operation, the residual is truncated
DPLLNum+=1;
else
if (DPLLNum < 190000)
DPLLNum+=2;
else
if (DPLLNum < 350000)
DPLLNum+=3;
else
DPLLNum+=4;


if ((sig_type==0) || (sig_type==3)) // SR calculation for DSD signals (either native or DoP)
{
if(sampleRate>461520)
{
SR = 0;
if (input == 0)
{
DPLL_DSD = 15;
setDPLLDSD();
}
else if (input == 1)
{
DPLL_DSD = 15;
setDPLLDSD();
}
else if (input == 2)
{
DPLL_DSD = 15;
setDPLLDSD();
}
else if (input == 3)
{
DPLL_DSD = 15;
setDPLLDSD();
}
else if (input == 4)
{
DPLL_DSD = 15;
setDPLLDSD();
}
else if (input == 5)
{
DPLL_DSD = 15;
setDPLLDSD();
}
SerialUSB.println(F("Invalid DSD, DPLL set to 15"));
}
else
if(sampleRate>451000)
{
SR = 1;
if (input == 0)
{
DPLL_DSD = Input[0].DPLLDSD1;
setDPLLDSD();
}
else if (input == 1)
{
DPLL_DSD = Input[1].DPLLDSD1;
setDPLLDSD();
}
else if (input == 2)
{
DPLL_DSD = Input[2].DPLLDSD1;
setDPLLDSD();
}
else if (input == 3)
{
DPLL_DSD = Input[3].DPLLDSD1;
setDPLLDSD();
}
else if (input == 4)
{
DPLL_DSD = Input[4].DPLLDSD1;
setDPLLDSD();
}
else if (input == 5)
{
DPLL_DSD = Input[5].DPLLDSD1;
setDPLLDSD();
}
SerialUSB.println(F("44.8 MHz DSD"));
}
else
if(sampleRate>225700)
{
SR = 2;
if (input == 0)
{
DPLL_DSD = Input[0].DPLLDSD2;
setDPLLDSD();
}
else if (input == 1)
{
DPLL_DSD = Input[1].DPLLDSD2;
setDPLLDSD();
}
else if (input == 2)
{
DPLL_DSD = Input[2].DPLLDSD2;
setDPLLDSD();
}
else if (input == 3)
{
DPLL_DSD = Input[3].DPLLDSD2;
setDPLLDSD();
}
else if (input == 4)
{
DPLL_DSD = Input[4].DPLLDSD2;
setDPLLDSD();
}
else if (input == 5)
{
DPLL_DSD = Input[5].DPLLDSD2;
setDPLLDSD();
}
SerialUSB.println(F("22.4 MHz DSD"));
}
else
if(sampleRate>112000)
{
SR = 3;
if (input == 0)
{
DPLL_DSD = Input[0].DPLLDSD3;
setDPLLDSD();
}
else if (input == 1)
{
DPLL_DSD = Input[1].DPLLDSD3;
setDPLLDSD();
}
else if (input == 2)
{
DPLL_DSD = Input[2].DPLLDSD3;
setDPLLDSD();
}
else if (input == 3)
{
DPLL_DSD = Input[3].DPLLDSD3;
setDPLLDSD();
}
else if (input == 4)
{
DPLL_DSD = Input[4].DPLLDSD3;
setDPLLDSD();
}
else if (input == 5)
{
DPLL_DSD = Input[5].DPLLDSD3;
setDPLLDSD();
}
SerialUSB.println(F("11.2 MHz DSD"));
}
else
if(sampleRate>56000)
{
SR = 4;
if (input == 0)
{
DPLL_DSD = Input[0].DPLLDSD4;
setDPLLDSD();
}
else if (input == 1)
{
DPLL_DSD = Input[1].DPLLDSD4;
setDPLLDSD();
}
else if (input == 2)
{
DPLL_DSD = Input[2].DPLLDSD4;
setDPLLDSD();
}
else if (input == 3)
{
DPLL_DSD = Input[3].DPLLDSD4;
setDPLLDSD();
}
else if (input == 4)
{
DPLL_DSD = Input[4].DPLLDSD4;
setDPLLDSD();
}
else if (input == 5)
{
DPLL_DSD = Input[5].DPLLDSD4;
setDPLLDSD();
}
SerialUSB.println(F("5.6 MHz DSD"));
}
else
if ((sampleRate>28000) || (sampleRate>1700))
{
SR = 5;
if (input == 0)
{
DPLL_DSD = Input[0].DPLLDSD5;
setDPLLDSD();
}
else if (input == 1)
{
DPLL_DSD = Input[1].DPLLDSD5;
setDPLLDSD();
}
else if (input == 2)
{
DPLL_DSD = Input[2].DPLLDSD5;
setDPLLDSD();
}
else if (input == 3)
{
DPLL_DSD = Input[3].DPLLDSD5;
setDPLLDSD();
}
else if (input == 4)
{
DPLL_DSD = Input[4].DPLLDSD5;
setDPLLDSD();
}
else if (input == 5)
{
DPLL_DSD = Input[5].DPLLDSD5;
setDPLLDSD();
}
SerialUSB.println(F("2.8 MHz DSD"));
}
else
{
SR = 0;
if (input == 0)
{
DPLL_DSD = 15;
setDPLLDSD();
}
else if (input == 1)
{
DPLL_DSD = 15;
setDPLLDSD();
}
else if (input == 2)
{
DPLL_DSD = 15;
setDPLLDSD();
}
else if (input == 3)
{
DPLL_DSD = 15;
setDPLLDSD();
}
else if (input == 4)
{
DPLL_DSD = 15;
setDPLLDSD();
}
else if (input == 5)
{
DPLL_DSD = 15;
setDPLLDSD();
}
SerialUSB.println(F("Invalid DSD, DPLL set to 15."));
}
}

if (sig_type==1 || sig_type==2) // If signal is PCM (either SPDIF or I2S)
{
if(sampleRate>7690)
{
SR = 0;
if (input == 0)
{
DPLL_PCM = 15;
setDPLLPCM();
}
else if (input == 1)
{
DPLL_PCM = 15;
setDPLLPCM();
}
else if (input == 2)
{
DPLL_PCM = 15;
setDPLLPCM();
}
else if (input == 3)
{
DPLL_PCM = 15;
setDPLLPCM();
}
else if (input == 4)
{
DPLL_PCM = 15;
setDPLLPCM();
}
else if (input == 5)
{
DPLL_PCM = 15;
setDPLLPCM();
}
SerialUSB.println(F("Invalid SR, DPLL set to 15."));
}
else
if(sampleRate>7675)
{
SR = 6;
if (input == 0)
{
DPLL_PCM = Input[0].DPLLPCM1;
setDPLLPCM();
}
else if (input == 1)
{
DPLL_PCM = Input[1].DPLLPCM1;
setDPLLPCM();
}
else if (input == 2)
{
DPLL_PCM = Input[2].DPLLPCM1;
setDPLLPCM();
}
else if (input == 3)
{
DPLL_PCM = Input[3].DPLLPCM1;
setDPLLPCM();
}
else if (input == 4)
{
DPLL_PCM = Input[4].DPLLPCM1;
setDPLLPCM();
}
else if (input == 5)
{
DPLL_PCM = Input[5].DPLLPCM1;
setDPLLPCM();
}
SerialUSB.println(F("768K PCM"));
}
else
if(sampleRate>7050)
{
SR = 7;
if (input == 0)
{
DPLL_PCM = Input[0].DPLLPCM2;
setDPLLPCM();
}
else if (input == 1)
{
DPLL_PCM = Input[1].DPLLPCM2;
setDPLLPCM();
}
else if (input == 2)
{
DPLL_PCM = Input[2].DPLLPCM2;
setDPLLPCM();
}
else if (input == 3)
{
DPLL_PCM = Input[3].DPLLPCM2;
setDPLLPCM();
}
else if (input == 4)
{
DPLL_PCM = Input[4].DPLLPCM2;
setDPLLPCM();
}
else if (input == 5)
{
DPLL_PCM = Input[5].DPLLPCM2;
setDPLLPCM();
}
SerialUSB.println(F("705.6K PCM"));
}
else
if(sampleRate>3835)
{
SR = 8;
if (input == 0)
{
DPLL_PCM = Input[0].DPLLPCM3;
setDPLLPCM();
}
else if (input == 1)
{
DPLL_PCM = Input[1].DPLLPCM3;
setDPLLPCM();
}
else if (input == 2)
{
DPLL_PCM = Input[2].DPLLPCM3;
setDPLLPCM();
}
else if (input == 3)
{
DPLL_PCM = Input[3].DPLLPCM3;
setDPLLPCM();
}
else if (input == 4)
{
DPLL_PCM = Input[4].DPLLPCM3;
setDPLLPCM();
}
else if (input == 5)
{
DPLL_PCM = Input[5].DPLLPCM3;
setDPLLPCM();
}
SerialUSB.println(F("384K PCM"));
}
else
if(sampleRate>3510)
{
SR = 9;
if (input == 0)
{
DPLL_PCM = Input[0].DPLLPCM4;
setDPLLPCM();
}
else if (input == 1)
{
DPLL_PCM = Input[1].DPLLPCM4;
setDPLLPCM();
}
else if (input == 2)
{
DPLL_PCM = Input[2].DPLLPCM4;
setDPLLPCM();
}
else if (input == 3)
{
DPLL_PCM = Input[3].DPLLPCM4;
setDPLLPCM();
}
else if (input == 4)
{
DPLL_PCM = Input[4].DPLLPCM4;
setDPLLPCM();
}
else if (input == 5)
{
DPLL_PCM = Input[5].DPLLPCM4;
setDPLLPCM();
}
SerialUSB.println(F("352.8K PCM"));
}
else
if(sampleRate>1910)
{
SR = 10;
if (input == 0)
{
DPLL_PCM = Input[0].DPLLPCM5;
setDPLLPCM();
}
else if (input == 1)
{
DPLL_PCM = Input[1].DPLLPCM5;
setDPLLPCM();
}
else if (input == 2)
{
DPLL_PCM = Input[2].DPLLPCM5;
setDPLLPCM();
}
else if (input == 3)
{
DPLL_PCM = Input[3].DPLLPCM5;
setDPLLPCM();
}
else if (input == 4)
{
DPLL_PCM = Input[4].DPLLPCM5;
setDPLLPCM();
}
else if (input == 5)
{
DPLL_PCM = Input[5].DPLLPCM5;
setDPLLPCM();
}
SerialUSB.println(F("192K PCM"));
}
else
if(sampleRate>1756)
{
SR = 11;
if (input == 0)
{
DPLL_PCM = Input[0].DPLLPCM6;
setDPLLPCM();
}
else if (input == 1)
{
DPLL_PCM = Input[1].DPLLPCM6;
setDPLLPCM();
}
else if (input == 2)
{
DPLL_PCM = Input[2].DPLLPCM6;
setDPLLPCM();
}
else if (input == 3)
{
DPLL_PCM = Input[3].DPLLPCM6;
setDPLLPCM();
}
else if (input == 4)
{
DPLL_PCM = Input[4].DPLLPCM6;
setDPLLPCM();
}
else if (input == 5)
{
DPLL_PCM = Input[5].DPLLPCM6;
setDPLLPCM();
}
SerialUSB.println(F("176.4K PCM"));
}
else
if(sampleRate>954)
{
SR = 12;
if (input == 0)
{
DPLL_PCM = Input[0].DPLLPCM7;
setDPLLPCM();
}
else if (input == 1)
{
DPLL_PCM = Input[1].DPLLPCM7;
setDPLLPCM();
}
else if (input == 2)
{
DPLL_PCM = Input[2].DPLLPCM7;
setDPLLPCM();
}
else if (input == 3)
{
DPLL_PCM = Input[3].DPLLPCM7;
setDPLLPCM();
}
else if (input == 4)
{
DPLL_PCM = Input[4].DPLLPCM7;
setDPLLPCM();
}
else if (input == 5)
{
DPLL_PCM = Input[5].DPLLPCM7;
setDPLLPCM();
}
SerialUSB.println(F("96K PCM"));
}
else
if(sampleRate>878)
{
SR = 13;
if (input == 0)
{
DPLL_PCM = Input[0].DPLLPCM8;
setDPLLPCM();
}
else if (input == 1)
{
DPLL_PCM = Input[1].DPLLPCM8;
setDPLLPCM();
}
else if (input == 2)
{
DPLL_PCM = Input[2].DPLLPCM8;
setDPLLPCM();
}
else if (input == 3)
{
DPLL_PCM = Input[3].DPLLPCM8;
setDPLLPCM();
}
else if (input == 4)
{
DPLL_PCM = Input[4].DPLLPCM8;
setDPLLPCM();
}
else if (input == 5)
{
DPLL_PCM = Input[5].DPLLPCM8;
setDPLLPCM();
}
SerialUSB.println(F("88.2K PCM"));
}
else
if(sampleRate>475)
{
SR = 14;
if (input == 0)
{
DPLL_PCM = Input[0].DPLLPCM9;
setDPLLPCM();
}
else if (input == 1)
{
DPLL_PCM = Input[1].DPLLPCM9;
setDPLLPCM();
}
else if (input == 2)
{
DPLL_PCM = Input[2].DPLLPCM9;
setDPLLPCM();
}
else if (input == 3)
{
DPLL_PCM = Input[3].DPLLPCM9;
setDPLLPCM();
}
else if (input == 4)
{
DPLL_PCM = Input[4].DPLLPCM9;
setDPLLPCM();
}
else if (input == 5)
{
DPLL_PCM = Input[5].DPLLPCM9;
setDPLLPCM();
}
SerialUSB.println(F("48K PCM"));
}
else
if(sampleRate>430)
{
SR = 15;
if (input == 0)
{
DPLL_PCM = Input[0].DPLLPCM10;
setDPLLPCM();
}
else if (input == 1)
{
DPLL_PCM = Input[1].DPLLPCM10;
setDPLLPCM();
}
else if (input == 2)
{
DPLL_PCM = Input[2].DPLLPCM10;
setDPLLPCM();
}
else if (input == 3)
{
DPLL_PCM = Input[3].DPLLPCM10;
setDPLLPCM();
}
else if (input == 4)
{
DPLL_PCM = Input[4].DPLLPCM10;
setDPLLPCM();
}
else if (input == 5)
{
DPLL_PCM = Input[5].DPLLPCM10;
setDPLLPCM();
}
SerialUSB.println(F("44.1K PCM"));
}
else
if(sampleRate>310)
{
SR = 16;
if (input == 0)
{
DPLL_PCM = Input[0].DPLLPCM11;
setDPLLPCM();
}
else if (input == 1)
{
DPLL_PCM = Input[1].DPLLPCM11;
setDPLLPCM();
}
else if (input == 2)
{
DPLL_PCM = Input[2].DPLLPCM11;
setDPLLPCM();
}
else if (input == 3)
{
DPLL_PCM = Input[3].DPLLPCM11;
setDPLLPCM();
}
else if (input == 4)
{
DPLL_PCM = Input[4].DPLLPCM11;
setDPLLPCM();
}
else if (input == 5)
{
DPLL_PCM = Input[5].DPLLPCM11;
setDPLLPCM();
}
SerialUSB.println(F("32K PCM"));
}
}
}
  Reply With Quote
Old 25th February 2020, 07:40 AM   #13
Poni is offline Poni
diyAudio Member
 
Join Date: Jun 2013
Hi Branko,

Just to start I also had some time to make changes lately and added remote controller functionality and some other minor changes. The new version is on github if you are interested.

Maybe i will have some time next weeks to program sample rate as well... would be the next step.


Now the sample rate form code you pasted, basically, if the code is written for the same Sabre ESS DAC it should work as it is, if you copy all the parts, functions and variables of course... and that's the problem I personally have with this code, its like spaghetti...all mixed up. So at the end if you want one function you need to copy half of the program all even all of it... Its still great job from DimDim, he made it work and that counts. I'm sure it works great on his application, but i would not copy it just as it is.


You ask:
"Also I would need how to tell what signal type is playing (DOD; DSD; PCM and Spdif or I2S) for the calculations. How do I get this info with your code?"

Look here, this is how DimDim is doing it:...he first check the Bit 0 from register 40 if the lock is on... 1 is on 0 no lock then from register 64 he gets signal type.

void getLockStatus()
{
byte r = ReadRegister(dac, 0x40); // Read Reg64
if (bitRead(r,0) == 1) // DAC has lock
{
lock = 1;
r = ReadRegister(dac, 0x64);
//SerialUSB.print("Reg100: "); SerialUSB.println(r, BIN);
//r = r << 4;
if (bitRead(r, 3) == 1)
{
sig_type = 0; // Decoded signal type is DoP
}
else if (bitRead(r, 2) == 1)
{
sig_type = 1; // Decoded signal type is SPDIF
}
else if (bitRead(r, 1) == 1)
{
sig_type = 2; // Decoded signal type is I2S
}
else if (bitRead(r, 0) == 1)
{
sig_type = 3; // Decoded signal type is DSD
}
SerialUSB.print(F("DAC has locked to a signal of type "));
SerialUSB.println(sig_type);
}
else if (bitRead(r,0) == 0)// DAC has no lock
{
SerialUSB.println(F("No Lock"));
lock = 0;
}
}


I would make 2 function from it... one getLockStatus (this returns lock status enum), and second one, getSignalType (return signal type enum).But go the way TPA is doing it, its great job... Look in the ES9028_38.h file, there are registers already defined.

// Register 64: Chip ID and Status - READ ONLY
#define R64_LOCK_STATUS_UNLOCKED 0b0
#define R64_LOCK_STATUS_LOCKED 0b1
#define R64_AUTOMUTE_INACTIVE 0b0
#define R64_AUTOMUTE_ACTIVE 0b1

you read the register 64 for lock and return lock status. I defined lock status enum LOCK_STATUS in my program, but you dont even need to use this one, you can return just byte or use TPA union... R64_CHIP_ID_STATUS

So there are many options, I followed the principle to return the enum (as i wanted to simplify the code), but if you want, you can even define R64_CHIP_ID_STATUS chip_status variable in DAC class and in getLockStatus you just set the chip_status.lock_status = xxx... one option ist to read the register 64 here and make switch from byte:

switch ( byte_from_64 ){
case: R64_LOCK_STATUS_LOCKED
return LOCK_STATUS::locked
....
}

or even better, read the whole register to union (i haven't test it but it should work) then use switch or if

R64_CHIP_ID_STATUS chip_status = readRegister(PE_ADDRESS, 64);
if ( chip_status.lock_status == R64_LOCK_STATUS_LOCKED ) {...}


TPA union is already there in ES9028_38.h:

typedef union {
struct {
B lock_status :1;
B automute_status :1;
B chip_id :6;
};
B byte;
} R64_CHIP_ID_STATUS;

You do the same with signal type... look again in ES9028_38.h file, the already defined union for us... you just need to read the register 100.
union is alrady defined
// Register 100: Input status - READ ONLY
typedef union {
struct {
B dsd_is_valid :1;
B i2s_is_valid :1;
B spdif_is_valid :1;
B dop_is_valid :1;
B reserved :4;
};
B byte;
} R100_INPUT_STATUS;

... but define the values first, something like this (I dont know the register settings here):
#define R100_DSD_VALID 0b0 ??? match the register values here (i dont know it)
#define R100_I2S_VALID 0b1 ???...


this is how you read the register:


//0x40 is equal to 64
#define REG_LOCK_MUTE 0x40
readRegister(PE_ADDRESS, REG_LOCK_MUTE);


So i would get the two functions first getLockStatus and getSignalType thats half of the way... later according to signal type you can calculate sample rate or switch dpll if needed

this is how TPA is writing DPLL register... for later use

R12_JE_DPLL_BW r12;
uint8_t dpll = sw2.dpll;
// we don't ever want the DPLL to be off
if (dpll == 0) dpll = 5;
r12.byte = R12_DEFAULT;
r12.dpll_bw_serial = dpll;
r12.dpll_bw_dsd = dpll;
writeRegister(DAC_ADDRESS, 12, r12.byte);

It maybe all confusing at the beginning, but TPA made here great job, but as it is Microcontroller C, wrapping it around the class is the best way to go and the most flexible.

Hope it will help.
  Reply With Quote
Old 25th February 2020, 09:17 AM   #14
drone is offline drone  Germany
diyAudio Member
 
Join Date: Jan 2006
Location: Germany Rheinarea
Hello Poni,

as always I am impressed by your will to spend so much time and patience on these things.

As I starte with my idea of building my own dad it was all about "Modularity". I wanted to use only the things I need: DAC with PSU in separate enclosure. Source with PSU (BBB network streamer, USB to I2S etc) in separatete enclosures. So I could change or modify alway one thing per time and leaving the others in working state.

Therefor you approach to the software is so appealing to me: splitting it up in several classes and use only these you need.

Unfortunately this is beyond my skills (I try to get there but progress is slow ).

I also think dimdim's code is great an I use it a lot to learn from.
But I think your code is the way to go.

Just add "classes" for all purposes and use only these you want for your DAC project.

For me it would be: several display types (TFT; TFT Nextion; LED matrix etc.); display sampling rate. DPLL and filter settings for each playing input; storing the latest settings in eprom (i. e. latest Input, volume etc.).

I would be glad to help. But this is over my level (the and skill). But I try

So I tank everyone in this great community willing to share.

Branko
  Reply With Quote
Old 25th February 2020, 11:29 AM   #15
Poni is offline Poni
diyAudio Member
 
Join Date: Jun 2013
Hi Branko,


"Just add "classes" for all purposes and use only these you want for your DAC project."
You nailed it with it, that's how it suppose to work...


The C approach of HiFiDuino and later DimDim is fine for small programs. I personally used C approach, with no classes to program my DAM1021 DAC, which is also on github. Its definitely easier to start, but along the way it always grows to mess.

This is simplified DAM1021:

Click the image to open in full size.


and how it works:

C0035.MP4 - Google Drive



The trigger to write C++ OO was actually TPA making the firmware public... I didnt want to write all the firmware from scratch, so I used TPA firmware for DAC. If you look closely DAC class is just wrap around TPA firmware and I think its perfect, as i can be sure all register are set properly and change just the bits I want.

The other way would be to make BBB nice state of art software, but it has to load operating system and all that stuff, powering down is an issue too. Microcontroller starts instantly and you just cannot make any harm to it, cut the power to turn it off is just fine... doing so with BBB is playing with fire.

But at the end I think most of the folks has their Buffalos up and running, so its all probably bit too late

But yeah, for your modular build it would be perfect, especially having many displays would be easy to apply without messing with the code at all. But storing the settings in EEPROM is also easy to apply and no need to make any changes to existing code.


But as you have noticed it can be overwhelming at the beginning with all the classes, inheritances, definitions and so on. So I think one needs some basics in C++ Object Oriented programming to make best of it.

I have strong basics in C++ OO, so its intuitive somehow, but i know it can be pain in the *** for someone who is not familiar. C++ itself is also not the easiest language to follow.


Anyway, as I said, I want to make some changes next weeks, like sample rate, or EEPROM, but dont know when. Will let you know once I get some parts done, lock + signal type shouldn't be a problem, so i will start there.

Last edited by Poni; 25th February 2020 at 11:46 AM.
  Reply With Quote
Old 25th February 2020, 11:37 AM   #16
Poni is offline Poni
diyAudio Member
 
Join Date: Jun 2013
But tell me how did it work with your LCD, have you made it work as you wanted?
  Reply With Quote
Old 26th February 2020, 07:45 PM   #17
drone is offline drone  Germany
diyAudio Member
 
Join Date: Jan 2006
Location: Germany Rheinarea
Hello,

I wanted to display sampling rate and source. ( like this: SATIE)
Therefor I tried to get progress with the sampling rate

Also I had to build a „cape“ for the Arduino due to connect my displays simultaneously for testing purposes. Just received it from OSH-Park. Further I have to find out how to set brightness on my displays depending on ambient light by sensor. This may also be of interest for the TFT Display? It would be nice to dim the overall brightness after a few seconds a settings change is made.
Will try to post some info when I make progress.

Regards
Branko
  Reply With Quote
Old 28th February 2020, 03:08 PM   #18
francolargo is offline francolargo  United States
diyAudio Member
 
Join Date: Mar 2007
Location: Twin Cities, MN
Quote:
Originally Posted by Poni View Post
But as you have noticed it can be overwhelming at the beginning with all the classes, inheritances, definitions and so on. So I think one needs some basics in C++ Object Oriented programming to make best of it.

I have strong basics in C++ OO, so its intuitive somehow, but i know it can be pain in the *** for someone who is not familiar. C++ itself is also not the easiest language to follow.
Greetings Poni,

I very much agree about the obstacle of learning C++. I have solved it by instead using Python for my DACs! Because my programming is only for my diyAudio hobby - i.e., not extremely demanding - things are working well. My previous project used the BBB for I2C to the ES9028 DAC, but I did not have all the control I wanted so I added an RPi for overall system control. The RPi doesn't touch the music, but gives 'hands-off' control for the entire system. My DIY components are not so pretty as yours (which are exceptional! ), so with current software I can keep the generic rack boxes completely hidden.

My current project is to control ES90x8 DACs having USB sources. I'm now learning to fabricate a 'hat' with RPi GPIO pin compatibility. The 'hat' will maintain isolation of the controls, and the RPi can also be an audio input via USB. In addition to I2C control of the DAC, this 'hat' will also replace the 3.3v Trident to the BIII clock in order to switch configurations between running as 'true-synch' vs. oversampling mode. When I finally get code working, I'll report on the other thread linked above. For this new project, I hope to make really attractive boxes - but probably not as nice as yours.

Cheers,

Frank
  Reply With Quote
Old 19th March 2020, 04:45 PM   #19
drone is offline drone  Germany
diyAudio Member
 
Join Date: Jan 2006
Location: Germany Rheinarea
Hello,

hope you and your family/friends are all well and healthy.

As I have to stay at home due to the Virus-Situation, I would try to get some further with my Buffalo build.

Just build a test rig with different displays

Did you make some steps with the software?

Regards

Branko
  Reply With Quote
Old 19th March 2020, 07:36 PM   #20
francolargo is offline francolargo  United States
diyAudio Member
 
Join Date: Mar 2007
Location: Twin Cities, MN
Greetings Branko,

Thanks for your kind words. The USA is not well prepared for what is to come, but as a retired medical professional I'm fine. ...and also working on my own B3Pro project during these quiet times!

Perhaps you were inquiring about the C++ code, but it's quiet so here is an update on the Python-based project: The interface boards to provide galvanic isolation are all designed and ordered, and they should arrive in about 2 weeks. For my projects, I feel that a front-panel display would merely duplicate information that is more conveniently given in other formats. However, I realize that a nice OLED adds credibility to an impressive chassis and so I applaud those who wish to include them.

The interface board uses the 2X20 GPIO scheme from the Raspberry Pi because it has been adopted by many other SBC makers. [The Raspberry kernel is easiest to work with among those I have tried.] The board is very generalized in function and would allow either SPI or I2C control of small displays (along with all of the isolated functionality to/from the B3Pro). For my own project, I am bringing the RPi HDMI connection to the chassis back panel, should there be a need for a serious GUI, or even video display.

That's all for now. It will be several weeks still before any control code is written.

Best,

Frank
Attached Images
File Type: png Screen Shot 2020-03-19 at 2.08.54 PM.png (360.4 KB, 18 views)
  Reply With Quote

Reply


C++ Easy and Scalable Software for BIII38ProHide 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
Scalable PSU/regulator GB BobEllis Group Buys 655 2nd June 2015 09:52 PM
Easy, simple to use software for measuring FR, impulse, etc? makingmoney Multi-Way 7 6th July 2010 09:45 AM
Easy PCB Software Bonanza Software Tools 3 31st May 2010 10:23 AM


New To Site? Need Help?

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


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