Hello Guys
I am trying to control Muses72323 by Arduino UNO.
This is the schematic of testing PCB
This is PCB
I connected the TestPCB to Arduino UNO as following:
TestPCB----------->UNO
P2(VIN-5V)------->5V
P2(GND-IN)------>GND
P2(SDL-IN)------->D10(CS)
P2(SCL-IN)------->D13(SCK)
P2(SDA-IN)------>D11(MOSI)
and I connected ±15V power to P1(Power) socket
I put the signal in to In+(Pin27,INL) and conneted the OUTL(Pin3,OUTL) to Osilloscope, and connected the RCA GND of input and output to the A-GND of test circuit.
I am trying to control Muses72323 by Arduino UNO.
This is the schematic of testing PCB
This is PCB
I connected the TestPCB to Arduino UNO as following:
TestPCB----------->UNO
P2(VIN-5V)------->5V
P2(GND-IN)------>GND
P2(SDL-IN)------->D10(CS)
P2(SCL-IN)------->D13(SCK)
P2(SDA-IN)------>D11(MOSI)
and I connected ±15V power to P1(Power) socket
I put the signal in to In+(Pin27,INL) and conneted the OUTL(Pin3,OUTL) to Osilloscope, and connected the RCA GND of input and output to the A-GND of test circuit.
this is the Arduino testing code
#include <SPI.h>
//address of Muses72323(the Jumper of ADR0 and ADR1 are open, so the address is 0)
const uint8_t MUSES_ADDRESS = 0;
//the SPI pins
#define MUSES_CLK 13
#define MUSES_MOSI 11
#define MUSES_CS 10
//define the Volume
const long defaultVolume = 232; //重启后的默认音量 232=-50dB
long currentVolume = 32; //当前音量,从32=0dB开始
const long minVolume = 479; //最小音量479=-111.75dB
const long maxVolume = 32; //最大音量 32=0dB
//控制信号寄存器参数
const uint8_t musesLeftAtt = 0b0010000; //控制左声道,Soft step功能打开
const uint8_t musesRightAtt = 0b0010100; //控制右声道,Soft step功能打开
void setup() {
Serial.begin(115200);
//设置CS脚位状态
pinMode(MUSES_CS, OUTPUT);
digitalWrite(MUSES_CS, HIGH);
//初始化Muses72323
SPI.begin();
SPI.beginTransaction(SPISettings(250000, MSBFIRST, SPI_MODE0));
//Muses72323初始状态时是Mute,设置一个默认音量来启动声音
//musesWriteVolume(defaultVolume, defaultVolume);
}
void loop() {
// put your main code here, to run repeatedly:
currentVolume += 1;
if (currentVolume > 479)
{
currentVolume = 0;
}
Serial.print("currentVolume = ");
Serial.println(currentVolume);
musesWriteVolume(currentVolume, currentVolume);
delay(10);
}
void musesWriteVolume(long leftVolume, long rightVolume)
{
uint8_t address;
long data;
//写入左声道寄存器
address = musesLeftAtt;
data = leftVolume;
musesWriteRaw(address, data);
//写入右声道寄存器
address = musesRightAtt;
data = rightVolume;
musesWriteRaw(address, data);
}
void musesWriteRaw(uint8_t address, long data) {
uint16_t value = 0; //写入Muses72323芯片的寄存器数值D15~D0;
uint8_t value1 = 0;
uint8_t value2 = 0;
int temp = 0;
for(int i = 0; i<7; i++) //将地址数值写入data的0~6位
{
temp = bitRead(address, i);
bitWrite(value, i, temp);
}
for(int i = 0; i<9; i++) //将音量控制数据写入data的7~15位
{
temp = bitRead(data, i);
bitWrite(value, i+7, temp);
}
//通过串口监视器显示写入的数值,测试用
Serial.print("value:");
Serial.println(value, BIN);
for(int i=0; i<8; i++)
{
temp = bitRead(value, i);
bitWrite(value1, i, temp);
}
Serial.print("value1:");
Serial.println(value1, BIN);
for(int i=0; i<8; i++)
{
temp = bitRead(value, i+8);
bitWrite(value2, i, temp);
}
Serial.print("value2:");
Serial.println(value2, BIN);
// 拉低CS脚位电平,准备写入
digitalWrite(MUSES_CS, LOW);
delayMicroseconds(1); // this can be improved
// send in the address and value via SPI
//SPI.transfer(value);
SPI.transfer(value2);
SPI.transfer(value1);
// 拉高CS脚位电平,完成写入
delayMicroseconds(1); // this can be improved
digitalWrite(MUSES_CS, HIGH);
}
to simplify the test, I only transfer defaultVolume(-50dB) to Muses72323
void loop() {
// put your main code here, to run repeatedly:
currentVolume += 1;
if (currentVolume > 479)
{
currentVolume = 0;
}
Serial.print("currentVolume = ");
Serial.println(currentVolume);
//musesWriteVolume(currentVolume, currentVolume);
musesWriteVolume(defaultVolume, defaultVolume);
delay(10);
}
and I get the data of SPI sent by UNO
D3----------D0
0 0 0 0
which means Left Channel(00), and chip address =00
D6----D4
0 0 1
which means SS_L is ON
D15-----------------D7
011101000
it is 232(DEC), -(data-32)/4, -(232-32)/4=-50dB
the data that UNO sent by SPI is correct, but still has no output.
Could anyone help me to figure out the problem?
D3----------D0
0 0 0 0
which means Left Channel(00), and chip address =00
D6----D4
0 0 1
which means SS_L is ON
D15-----------------D7
011101000
it is 232(DEC), -(data-32)/4, -(232-32)/4=-50dB
the data that UNO sent by SPI is correct, but still has no output.
Could anyone help me to figure out the problem?
I can be wrong, but which is the "source" of D_IN 5V ?
From your schematic it seems that +5v for D_in is connected to VDD2 of ADUM130 only.
This can't work. Digital isolator do not transfer power from one side to the other.
You need to derivate the D_IN from +15v (with a voltage regulator) or use a different ps for digital 5v clean side of the isolator.
Or get rid of the isolator...
From your schematic it seems that +5v for D_in is connected to VDD2 of ADUM130 only.
This can't work. Digital isolator do not transfer power from one side to the other.
You need to derivate the D_IN from +15v (with a voltage regulator) or use a different ps for digital 5v clean side of the isolator.
Or get rid of the isolator...
Problem solved.
It is needed to turn on the internal clock, befor doing any control of Muses 72323
I defined a uint16_t virable to write to the register of Muses72323
It is needed to turn on the internal clock, befor doing any control of Muses 72323
I defined a uint16_t virable to write to the register of Muses72323
I put the following code in Setup()const uint16_t setInternalClock = 0b0000001000001100;
void setup() {
Serial.begin(115200);
//set CS pin
pinMode(MUSES_CS, OUTPUT);
digitalWrite(MUSES_CS, HIGH);
//initialize SPI
SPI.begin();
SPI.beginTransaction(SPISettings(250000, MSBFIRST, SPI_MODE0));
//turn ON internal clock
digitalWrite(MUSES_CS, LOW);
delayMicroseconds(1); // this can be improved
// send in the address and value via SPI
SPI.transfer(highByte(setInternalClock));
SPI.transfer(lowByte(setInternalClock));
delayMicroseconds(1); // this can be improved
digitalWrite(MUSES_CS, HIGH);
SPI.endTransaction();
}
Hello jerrylong,
I am very interested in your project, since I am working on a scalable Arduino based Pre-Amp controller.
Did you make more progress on this?
As I understood, you were able to write specific volume levels to the muses, right?
With kind regards,
Felix
I am very interested in your project, since I am working on a scalable Arduino based Pre-Amp controller.
Did you make more progress on this?
As I understood, you were able to write specific volume levels to the muses, right?
With kind regards,
Felix
- Home
- Amplifiers
- Pass Labs
- Muses72323 on Arduino Uno test