This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DAC8775EVM: What happens if I accidentally connected DVDD in reverse

Part Number: DAC8775EVM
Other Parts Discussed in Thread: DAC8775,

Tool/software:

All the shunts are connected as per default and I had mistakenly connected DVDD in reverse polarity at J4, J4-1 at 3.3V from the NUCLEO-F072RB. I immediately corrected it, and even after I have configured the registers correctly according to the datasheet, I can't seem to get channel A to output 10V.

I currently have:


void dac8775_Write(uint8_t cmd, uint16_t data);

dac8775_SetVoltage(uint8_t channel, float volts);


dac8775_Write(0x03, 0x0020);

dac8775_SetVoltage(0, 10.0f);

Am I doing something wrong? Or is the board permanently damaged? I am still new at this so I would appreciate any help in advance.

  • Muhammad,

    I'm not sure if the EVM is damaged, but we can check to see if the device is responding. The easiest way would be just to use the EVM in the original configuration. I would use the software GUI with the SM-USB-DIG and connected it through USB to the computer. Using the EVM GUI also shows what configuration is needed to set up the DAC output. If you have the GUI, you could set this up in a couple of minutes to test if the EVM is still working.

    For this device, you should make sure the EVM has a power supply (nominally 12V for PVDD/AVDD). Using the GUI, I would enable the buck-boost data converters, enable the reference, set the DAC range, and then enable the output. Setting the data code would then just change the DAC output.

    If you continue using your own MCU control, then I would still ensure the power supply is connected. I'd verify the SPI mode that you've used. I would also read back registers to make sure the write was completed. Follow the same configuration sequence that I listed above.

    Joseph Wu

  • Hi Joseph,

    Thanks for your swift reply. After playing around with the GUI, I noticed that I could get the desired 0-5V and 0-10V outputs.

    Also, I can't seem to be able to read 20mA on any of the channels, unless I'm not connecting the DMM correctly? I'm following the steps from a DAC8775EVM Youtube video by theBreadboard from 7 years ago, but I can't seem to get the current values despite this. 

    At this point of time, I would like some clarification.

    1) According to the datasheet of the DAC8775, the state of the SCLK doesn't matter prior to /SYNC going low, so am I right to set CPOL = 0, CPHA = 1 (2nd transition edge)?

    2) How would you set the current output on the DAC8775EVM?

  • Muhammad,


    1. You're correct the state of SCLK shouldn't matter prior to the /SYNC going low. The device is looking for the falling edge of SCLK for the transition. In that case, CPOL=0 and CPHA=1 works as the SPI mode.

    2. Using the device as a current output DAC should be as simple as setting the RANGE correctly. This would be RANGE[3:0] in the Configuration DAC Register at 0x04. If your having problems measuring the current, it might be a problem with the setup. Normally, I'd just set the output to have a specific load, maybe using the 249Ω resistor through JP18 on channel A. Then you can just measure the voltage at VOUT to verify the current. You could also use your multimeter as an ammeter and measure the current by shorting the output to ground (through the multimeter). If you're swapping between using the device as current or voltage outputs, the DAC8775 will have a hard time driving that low of a resistance through the entire voltage range.

    If you are swapping from voltage range to current range, you will need to set the DAC code again, and you might need to enable the DAC output again.


    Joseph Wu

  • Hi Joseph,

    Thanks for the reply. I have followed your suggestion in 2., and I managed to get the 20mA output. I have one last doubt to clarify and that is the configuration data that I need to send to the DAC via STM32CubeIDE. Can I confirm that I need to send 24-bits at once (8-bit address, 16-bit data) to the DAC, or do I send the data seperately?
    For example, I am following the DAC8775 datasheet 8.4.3 Write Operation, and I currently have:

    CS_EN();

    uint8_t RESET_REG[3] = {0x01, 0x00, 0x01};

    HAL_SPI_Transmit(&hspi2, RESET_REG, 3, HAL_MAX_DELAY);

    HAL_Delay(50);

    uint8_t RESET_CFG_REG[3] = {0x02, 0x01, 0x01}; // enable Internal ref & UBT = 1

    HAL_SPI_Transmit(&hspi2, RESET_CFG_REG, 3, HAL_MAX_DELAY);

    HAL_Delay(50);

    uint8_t SBB_A[3] = {0x06, 0x00, 0x01}; //set Buck Boost A

    HAL_SPI_Transmit(&hspi2, SBB_A, 3, HAL_MAX_DELAY);

    HAL_Delay(50);

    uint8_t CFG_BB_A[3] = {0x07, 0x00, 0x03}; //configure buck boost A

    HAL_SPI_Transmit(&hspi2, CFG_BB_A, 3, HAL_MAX_DELAY);

    HAL_Delay(50);

    uint8_t SEL_CHANNEL_A[3] = {0x03, 0x00, 0x02}; // select channel A

    HAL_SPI_Transmit(&hspi2, SEL_CHANNEL_A, 3, HAL_MAX_DELAY);

    HAL_Delay(50);

    uint8_t CFG_CHANNEL_A[3] = {0x04, 0x00, 0x01}; // configure channel A to output 0-10V

    HAL_SPI_Transmit(&hspi2, CFG_CHANNEL_A, 3, HAL_MAX_DELAY);

    HAL_Delay(50);

    while (1)

    {

    uint8_t DATA_A[3] = {0x05, 0xFF, 0xFF}; // Max value for 10V, put in while loop to keep the 10V alive

    HAL_SPI_Transmit(&hspi2, DATA_A, 3, HAL_MAX_DELAY);

    }

    Yet I am unable to get the desired 10V out of channel A. I have also removed shunt JP9 and shunted JP11 as I am using the MCU to power the DVDD at J4-2, following the EVM datasheet.

  • Muhammad,


    Yes, the communication to the device should send a 24 bit communication for each frame with 8 bits for the register address and 16 bits for the data.

    Taking a quick look at your code, I think I see three mistakes. First, the write to 0x02 to start the internal reference should be 0x0011 instead of 0x0101. Second, the write to 0x03 to select the DAC should be 0x0020 instead of 0x0002. This would select Channel A for operation. Third, the write to 0x04 for the configuration DAC should also include the enable of the DAC output using the OTEN bit. The write to the register should be 0x1001 instead of 0x0001.

    I think these changes should get the correct output. If it doesn't, I would try reading back from registers to verify the writes. Also, it might help to look at the communication with a logic analyzer to verify the SPI. It also helps in checking the register bits to see all of the data in a set of clock pulses.


    Joseph Wu

  • Hi Joseph,

    Thanks for correcting my errors. I have managed to get the correct transmit readings from my oscilloscope, but still no 10V output. Based on the other forum posts, I also checked my VPOS_A and VNEG_A, at TP1 and TP2, which give me 3.3V and 0.139V with respect to GND while JP1 and JP2 are at 1-2 position.

    1) Hence, I am trying to get readings from the registers to see if the DAC is actually receiving the data. For reading operation, is the following line of code correct?

    What I have done is to write to status register the UBT = 1 and send read op by having MSB = 1 and the next 7 bits to be the expected address (0x0B), which gives me 0x8B. However, after running my TransmitReceive, I do not see a waveform from MISO(SDO) when I send the NOP command.

    2) Also, I would like to confirm which of the Test Points indicated in 2.5.1 Communication Test Points of the DAC8775EVM User Guide be connected to my NUCLEO MCU board's GPIO outputs? I currently have all of them hooked up and I am wondering if LDAC, CLR or RESET were affecting them since I did not use them in my code.

    3) I have also tried to use Hardware NSS Output Signal in my SPI configuration, in case the CS timings were affecting the read operation (I was running the program line by line) but the issue still persisted.



     CS_EN();
     uint8_t write_2_status[3] = {0x0B, 0x10, 0x40};
     HAL_SPI_Transmit(&hspi2, write_2_status, 3, HAL_MAX_DELAY);
     CS_DIS();
     
     CS_EN();
     uint8_t read_tx[3] = {0x8B, 0x00, 0x00};
     HAL_SPI_Transmit(&hspi2, read_tx, 3, HAL_MAX_DELAY); // read status reg command
     HAL_Delay(1);
     CS_DIS();
      
     CS_EN();
     uint8_t no_op[3] = {0x00, 0x00, 0x00}; // No Op
     uint8_t rx[3] = {0,0,0};
     HAL_SPI_TransmitReceive(&hspi2, no_op, rx, 3, HAL_MAX_DELAY); // No Op
     CS_DIS(); 
     

  • Muhammad,


    The code look ok, but I'm not an experienced programmer, so I may miss things. The code looks like it's transmitting the write command to 0x0B with 0x1040 as the data. This is followed by the start of a read of 0x8B for the register followed by 0x0000 as space holders. Then the actual read comes in with the transmit of a NOP.

    In theory this looks ok. However, I think it's always best to look at the transmit of each of the SPI waveforms (SCLK, DIN, DOUT, CS) just to check to see that the communication is correct. Can you please post a picture of the waveforms with either a logic analyzer or 4 channel oscilloscope? It's probably the fastest way debug it, especially because you're not getting a response on the output.

    If you're using a different microcontroller to set the SPI, then you can use the test points shown in the section 2.5.1 to talk to the device. Just remember the name is on the bottom of each test point (it would have been better to label it on the side to read it better). I would also suggest that for debugging it would be easier to set the EVM back to the default settings, and use the SM-USB-DIG and talk to the device using the GUI. It's already set up to do it correctly, and you can use the logic analyzer to look at the SPI. That way you could use the communication as a template to compare your communication to the device.

    I assume that the Hardware NSS Output Signal is the /SS for the STM32 and you've replaced that here with some GPIO to set the equivalent signal. Again, I'd just look at the SPI with a logic analyzer to check it.


    Joseph Wu

  • Hi Joseph,

    After comparing with the signals from the GUI and the MCU I can confirm that the writes work, but for some reason the reads (MISO) echoes back the previous clock writes (MOSI) for example, I will write transmit (0x08B, 0x00, 0x00) and then when I send NOP (0x00, 0x00, 0x00) the MISO shows (0x08B, 0x00, 0x00) instead of the default values (0x0B, 0x10, 0x00)  or with the UBT = 1 (0x0B, 0x10, 0x40) that I have set earlier on. Also, when using the GUI, my VPOS_A = 15V but when I use the MCU the VPOS_A shows 3.3V. What am I missing? From the SM-USB-DIG to the MCU, I changed only JP9 (open) and JP13 (shunted) as indicated in the User Guide but nothing else.

  • Muhammad,

    Functionally, there really shouldn't be any difference between using the GUI and the using you own MCU. If you're getting back 0x0000 for the read instead of the default or written values, I would guess that you're still having a problem in the transmission. With VPOS_IN_A showing something other than +15V when you have set the device in voltage output mode, I'd say that you're write didn't occur correctly, which backs that up.

    Can you please post a scope photo of a write to the device from the MCU? And then post the SPI for the read back of the same register.


    Joseph Wu

  • Muhammad,

    I did check on the setup and if the buck boost converter isn't enabled, you would get about 3V on the VPOS_IN_x node. After the positive buck boost is enabled, you would see the node go to about 4.2V. Based on your setup, I don't thing the device is receiving data from your MCU.

    Because it's easy to monitor, I would just concentrate on one particular communication to enable the internal reference. You can measure the internal reference voltage on TP17 on the board and it should read 5V when it comes up. 

    Again, I would post the scope shot or logic analyzer image of the SPI communication, just for this communication. I would start testing the communication with only this write to the device. (I think this is just a simple write of 0x020010)

    Joseph Wu

  • Hi Joseph, 

    I have managed to acquire the 10V output! After going through all the points that you mentioned, I tried changing the /SYNC back to software and toggling it every line after my writes. Turns out that was all it took, to toggle CS after every write to the DAC. Thanks for all the tips and advice. Attached below is the working code for my 10V output for future reference.

     CS_DIS();
    
      HAL_GPIO_WritePin(GPIOC, DAC_RESET_Pin, GPIO_PIN_SET); // Set RESET pin to 'HIGH' (active low)
      HAL_GPIO_WritePin(GPIOC, DAC_LDAC_Pin, GPIO_PIN_SET);  // Set LDAC pin to 'HIGH' (active low)
      HAL_GPIO_WritePin(GPIOC, DAC_CLR_Pin, GPIO_PIN_RESET);   // Avoid clearing outputs
      HAL_Delay(10);  // Wait for device to come out of reset
    
      __HAL_SPI_ENABLE(&hspi2);
    
      printf("Sending DAC8775 Config...\r\n");
    
      CS_EN();
    
      uint8_t no_op[3] = {0x00, 0x00, 0x00}; // No Op
    
      uint8_t reset_reg[3] = {0x01, 0x00, 0x01};
      HAL_SPI_Transmit(&hspi2, reset_reg, 3, HAL_MAX_DELAY);
      HAL_Delay(1);
    
      CS_DIS();
    
      CS_EN();
    
      uint8_t reset_cfg_reg[3] = {0x02, 0x00, 0x10};  // enable Internal ref
      HAL_SPI_Transmit(&hspi2, reset_cfg_reg, 3, HAL_MAX_DELAY);
      HAL_Delay(1);
    
      CS_DIS();
    
      CS_EN();
    
      uint8_t set_bb_A[3] = {0x06, 0x00, 0x01}; //set Buck Boost A
      HAL_SPI_Transmit(&hspi2, set_bb_A, 3, HAL_MAX_DELAY);
      HAL_Delay(1);
    
      CS_DIS();
    
      CS_EN();
    
      uint8_t cfg_bb_A[3] = {0x07, 0x00, 0x03}; //configure buck boost A
      HAL_SPI_Transmit(&hspi2, cfg_bb_A, 3, HAL_MAX_DELAY);
      HAL_Delay(1);
    
      CS_DIS();
    
      CS_EN();
    
      uint8_t sel_channel_A[3] = {0x03, 0x00, 0x20}; // select channel A
      HAL_SPI_Transmit(&hspi2, sel_channel_A, 3, HAL_MAX_DELAY);
      HAL_Delay(1);
    
      CS_DIS();
    
      CS_EN();
    
      uint8_t cfg_channel_A_10V[3] = {0x04, 0x00, 0x01}; // configure channel A to output 0-10V
      HAL_SPI_Transmit(&hspi2, cfg_channel_A_10V, 3, HAL_MAX_DELAY);
      HAL_Delay(1);
    
      CS_DIS();
    
      CS_EN();
    
      uint8_t cfg_channel_A_ENO[3] = {0x04, 0x10, 0x01}; // enable output
      HAL_SPI_Transmit(&hspi2, cfg_channel_A_ENO, 3, HAL_MAX_DELAY);
      HAL_Delay(1);
    
      CS_DIS();
    
      CS_EN();
    
      uint8_t data_A[3] = {0x05, 0xFF, 0xFF}; // Half value = 5V
      HAL_SPI_Transmit(&hspi2, data_A, 3, HAL_MAX_DELAY);
    
      CS_DIS();