Image of connections on PCB: PCB_DAC7750
I have made minimum connections with DAC7750 namely AVDD(=11.5V), SDO, DIN, SCK, LATCH, GND as seen in the PCB (link to the image attached above). I am just making the current ramp-up and ramp-down using ESP32 inbuilt SPI library. I am also facing the same issue, as current not being detected on the output (Measured with an ammeter). AVDD varied from 10V to 18V but still the same issue. DVDD is not connected as DVDD_EN is open, which means an internal supply is enabled for digital peripherals inside. I have verified through oscilloscope that MOSI, SCL, SS signals are being generated on ESP32's pins. I have used the HSPI ports of the controller. I have kept the delays a little high for easy debugging on an oscilloscope.
#include <SPI.h> //#define ALARM #define HSPI_MISO 12 #define HSPI_MOSI 13 #define HSPI_SCLK 14 #define HSPI_SS 15 //To be connected to LATCH pin of DAC7750 //see pg32 datasheet #define Config 0x57 #define Ctrl 0x55 #define DAC_data 0x01 #define Reset 0x56 static const int spiClk = 1000; //freq in Hz SPIClass SPI2(HSPI); //Send values to DAC7750 in format 'address_of_register + data' //24-bit frame= 8bit addr + 16bit data //See pg10, Datasheet for timing diagram void Send(uint8_t addr, uint16_t value) { SPI2.transfer(addr); SPI2.transfer16(value); ///inbuilt function in SPI.h for 2bytes transfer digitalWrite(HSPI_SS, LOW); delay(1); digitalWrite(HSPI_SS, HIGH); delay(1); } void setup() { delay(1000); //Let the power supply be stable. pinMode(HSPI_SS, OUTPUT); digitalWrite(HSPI_SS, HIGH); // pinMode(ALARM, INPUT); SPI2.begin(HSPI_SCLK, HSPI_MISO, HSPI_MOSI, HSPI_SS); SPI2.beginTransaction(SPISettings(spiClk, MSBFIRST, SPI_MODE0)); //INITIALISE REGISTERS (pg34 onwards, Datasheet) //..Reset register Send(Reset, 0x0001); delay(1); //..config register Send(Config,0b0000000000001100); //disable HART, watchdog, error-check, calliberation delay(1); //..Data register -> initialise with all 0. (But is already at default reset) //Send(DAC_data, 0x0000); //last 4 LSB digits invalid for DAC7750 (to act as 12-bit) //delay(1); //..Control register Send(Ctrl, 0b0011000000001110); //o/p enable, o/p->0-20mA, current setting res enable delay(1); } void loop() { //send a ramp from 0 - 2mA, then const upto 30sec, then ramp to 0mA //ramp slope around 30sec uint16_t i=0; for(i=0; i<409; i++) //Current upto 2mA i.e. 409.5 value of 12bit-DAC in 30sec { Send(DAC_data, (i<<4)); delay(75); } delay(10000); for(i=409; i>=0; i--) //Current upto 2mA i.e. 409.5 value of 12bit-DAC in 30sec (16bit register, last 4bits useless) { Send(DAC_data, (i<<4)); delay(75); } delay(10000); }