Now I resoldering my shield, now I can control the IC.
But this only works on 0 and 255 all other value have a louder or quiter but the quality is criticaly :S
On the value 255 the sound quality is perfect, but all other value is sound makes crackling..
I don't understand what is the problem
Here is my code (based on spi by hand):
int SS1 = 5;
int CLK = 7;
int MOUT = 6;
byte ch1 = B00010001;
byte ch2 = B00010011;
byte ch3 = B00010010;
byte ch4 = B00010000;
byte ch5 = B00010101;
byte ch6 = B00010100;
byte work = B00000000;
void setup() {
pinMode(SS1, OUTPUT);
pinMode(CLK, OUTPUT);
pinMode(MOUT, OUTPUT);
digitalWrite(SS1, HIGH);
spi_out(SS1, ch1, 255);
spi_out(SS1, ch2, 255);
spi_out(SS1, ch3, 255);
spi_out(SS1, ch4, 255);
spi_out(SS1, ch5, 255);
spi_out(SS1, ch6, 255);
}
void spi_transfer(byte working) {
for(int i = 1; i <= 8; i++) {
if (working > 127) {
digitalWrite (MOUT,HIGH);
} else {
digitalWrite (MOUT, LOW);
}
digitalWrite (CLK,HIGH);
working = working << 1;
digitalWrite(CLK,LOW);
}
}
void spi_out(int SS, byte cmd_byte, byte data_byte) {
digitalWrite (SS, LOW);
work = cmd_byte;
spi_transfer(work);
work = data_byte;
spi_transfer(work);
digitalWrite(SS, HIGH);
}
void loop () {
}
when arduino power of the sound volume state go to middle posistion and the quality is so bad again.