MUSES Volume Control Chip - SPI

Gentlemen,

I need your help. I’m setting up a HiFi-PreAmplifier with a MUSES Volume Control Chip. This chip is controlled by the SPI-Bus.

I developed a code to control the chip. But I’m only able to control one chanel … Maybe somebody can have all into my code and the data sheet to give me a tip what I’m doing wrong …

My intention is, to control left and right channel linked, and not a single channels.

Here are the required information out of the data sheet:



And here is my code:

word Muses_Ini          = B10000000;  // L/R Cont 1: Controlling both Channels; Z/R Zero Crossing OM
word Muses_1_Adr        = B00000000;          // Adress of Chip 1
word Muses_2_Adr        = B00000001;          // Adress of Chip 2
word Muses_ConfigSelect = B01000000;          // Bit set to initialise the Chip
word Muses_VolumeSelect = B00000000;          // Bit set for Volume Control
word Muses_VolumeSelectL = B00000000;          // Bit set for Volume Control
word Muses_VolumeSelectR = B00100000;          // Bit set for Volume Control
word MusesVolume        = B00000000;          // Bit Mask for Volume
word MusesMute          = B11111111;          // Bit Mask for Mute
word MusesBitSet;  //16 Bit Mask ......

void StartMuses()
{
  pinMode(SlaveSelectPin, OUTPUT);
  SPI.begin();
  SPI.setBitOrder(MSBFIRST);
  SPI.setDataMode(SPI_MODE2);           // Initialise SPI
  SPI.setClockDivider(SPI_CLOCK_DIV64); // Set Correct speed for SPI Muses Chip
  MusesBitSet = Muses_Ini << 8 | Muses_ConfigSelect | Muses_1_Adr;
  Serial.println(MusesBitSet, BIN);
  Set_MUSES(MusesBitSet);
  SetVolume(StartVolume);
}


void SetVolume(int Volume)
{
  int MusesSet = -1*map(Volume, -223, 0, -239, -16);
  MusesBitSet = MusesSet << 8 | Muses_1_Adr | Muses_VolumeSelect;
  Serial.print(Volume*0.5); Serial.print("Left Channel db : BIN:");Serial.println(MusesBitSet, BIN);
  Set_MUSES(MusesBitSet);
  LastVolume = ActualVolume;
  ActualVolume=Volume;
}

void Set_MUSES(word Volume)
{
  digitalWrite(SlaveSelectPin, LOW); //MUSES LOW according datasheet
  SPI.transfer(highByte(Volume));
  SPI.transfer(lowByte(Volume));
  digitalWrite(SlaveSelectPin, HIGH); // HIGH after Transmission ....
}

Your help is appreciated :o

Happy New Year

Thank you :slight_smile:

Solved!!!