Greetings,
I may have bitten off more than I can chew with this one, given that I have very little experience with microcontrollers or digital electronics. It's a programmable gain amplifier using an Analog Devices multiplying DAC. This will be used as the front end of an audio power amplifier (hence the differential input). It is part of a much more complicated digital control system I am designing. This type of gain control has many advantages including precise level control and tight matching between channels.
The schematic for the interesting part is attached. Nothing very original, essentially the same circuit as described here:
https://www.analog.com/en/analog-dialogue/articles/high-resolution-multiplying-dacs.htmlHere is the Arduino test code for the AD5450.
#include <SPI.h>
int slaveSelect = 10;
void setup() {
pinMode(slaveSelect, OUTPUT);
SPI.begin();
}
void loop() {
ad5450Write(40);
delay(1000);
ad5450Write(225);
delay(1000);
ad5450Write(25);
delay(1000);
ad5450Write(0);
delay(1000);
}
void ad5450Write(int bitlevel){
digitalWrite(slaveSelect, LOW);
delay(10);
SPI.transfer(bitlevel);
delay(10);
digitalWrite(slaveSelect, HIGH);
}
Now for the issue I'm having. The differential input works as expected, and the DAC section sort of works. The problem I'm running into is that the DAC does not respond to the ad5450Write(225) command. In fact, it will not respond to anything above 63- theoretically, being an 8-bit DAC it should go up to 255. It simply stays at whatever it was last set to. Also of note, is that at a level of 63 the DAC section is unity gain, as if the DAC was set to a level of 255.
I'm not an expert when it comes to serial communication, so it's possible I made an error in my programming. The SYNC pin (slave select) is connected to pin 10 on the Arduino Uno, the SDIN pin is connected to pin 11, and SCLK is connected to pin 13.
I'm also not particularly experienced with SMD soldering, so I suppose there is the possibility that the DAC chip was damaged by overheating or ESD. Replacing the DAC is a not particularly trivial, as getting at it with a hot air station will be difficult without melting nearby IC sockets for the op-amps.
I'd greatly appreciate any suggestions on what to try here, as while I have experience with C++ and analog circuit design, my experience level with digital communication and microcontrollers is relatively limited.