# Write safeload to control Medium Size EQ

Question asked by JCB on Jul 31, 2014
Latest reply on Aug 1, 2014 by JCB

Hi all. Good day.

I'm trying to use MCU to send to safeload register to enable/disable Medium size EQ in SS Project. I'm having trouble in doing this.

The drawing was as per attached. I have no idea what's went wrongs. Hoping to get help in this forum.

The testing below were done to control EQ which center frequency is 2000Hz, Q=3, System Frequency Fs=48000Hz

Method 1: Mathematics calculation

I had tried to use the mathematics calculation as in Help> Algorithm Information > EQ Algorithm > Peaking

Common Variables:

boost = -40,   Fs= 48kHz,   f0 = 2000Hz,  gain =0,

A  = 10^(boost/40)

ω0 = 2*pi*f0/Fs

alpha = sin(ω0)/(2*Q)  //(type: Peaking)

gainLinear = 10^(gain/20)

 Coefficients a0 =  1 + alpha/Aa1 = -2 * cos(ω0)a2 =  1 - alpha/Ab0 = (1 + alpha*A) * gainLinearb1 = -(2 * cos(ω0)) * gainLinearb2 = (1 - alpha*A) * gainLinear

Yet,  no luck. Because this calculation would gave different values as in Capture Window.

Method 2: Capture Window

I had tried to use data from capture windows(as in attachment below). But still no luck. The 2kHz audio was still heard and persist.

**************************************************************************************************************************************

For you information, I'm using Arduino Ethernet. Communication to DSP was done in I2C. Tested connection is working fine by reading from DSP Readback block.

Here are the main part:

void loop (){

if(clicked){

val_EQ0B1[0] = 0x00; val_EQ0B1[1]= 0x59; val_EQ0B1[2]=0xcf; val_EQ0B1[3] =0x95;  // B0 {0x00, 0x59, 0xCF, 0x95};  *hard-coded values for f0=2000

val_EQ1B1[0] = 0xff; val_EQ1B1[1]= 0x53; val_EQ1B1[2]=0x3e; val_EQ1B1[3] =0x72;   //  B1 {0xff, 0x53, 0x3e, 0x72 };

val_EQ2B1[0] = 0x00; val_EQ2B1[1]= 0x59; val_EQ2B1[2]=0x0a; val_EQ2B1[3] =0x15;  // B2 {0x00, 0x59, 0x0a, 0x15 };

val_EQ1A1[0] = 0x00; val_EQ1A1[1]= 0xac; val_EQ1A1[2]=0xc1; val_EQ1A1[3] =0x8e;  // A1 {0x00, 0xac, 0xc1, 0x8e };

val_EQ2A1[0] = 0xff; val_EQ2A1[1]= 0xcd; val_EQ2A1[2]=0x26; val_EQ2A1[3] =0x56;   //  A2  {0xff, 0xcd, 0x26, 0x56 };

}

}

****************** Functions *************************

{

}

/* Safeload Data Register (2064 to 2068; 0x0810 TO 0x0814) Write Format*/

Wire.write(0x00);  //compulsory 0x00

byte c;

for ( c = 0; c < length; c++)      Wire.write(data[c]);

Wire.endTransmission();

/* Safeload Address Register (2069 to 2073; 0x0815 TO 0x819 ) Write Format*/

Wire.endTransmission();

}

{

/*set the initiate safeload transfer bit ( 5th bit )

Wire.write(0x08);

Wire.write(0x1C);  //address of DSP core control: 0x081C. Holds 2bytes data.

Wire.write(0x00);

Wire.write(0x3C);

}

Hope to hear from you soon. Thank you very much

Best Regards.

JCB