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.

DAC80501: Vout output issue.

Part Number: DAC80501


Tool/software:

Hello, i m using the dac80501 with this code to output some voltage, my issue whatever the command i send and value i give, i m getting 0v at Vout, i need help regarding this.

main.c

uint8_t cmd_1 = 0x05;

uint16_t data_1 = 0x000A;

uint8_t cmd_2 = 0x04;

uint16_t data_2 = 0x0101; //0x0001;

uint8_t cmd_3 = 0x08;

uint16_t data_3 = 0xFFFF; //0xFFFF;

write_dac80501(cmd_1, data_1);

HAL_Delay(10);

write_dac80501(cmd_2, data_2);

write_dac80501(cmd_3, data_3);

spi function

static void MX_SPI5_Init(void)

{

/* USER CODE BEGIN SPI5_Init 0 */

/* USER CODE END SPI5_Init 0 */

/* USER CODE BEGIN SPI5_Init 1 */

/* USER CODE END SPI5_Init 1 */

/* SPI5 parameter configuration*/

hspi5.Instance = SPI5;

hspi5.Init.Mode = SPI_MODE_MASTER;

hspi5.Init.Direction = SPI_DIRECTION_2LINES;

hspi5.Init.DataSize = SPI_DATASIZE_8BIT;

hspi5.Init.CLKPolarity = SPI_POLARITY_LOW;

hspi5.Init.CLKPhase = SPI_PHASE_2EDGE;

hspi5.Init.NSS = SPI_NSS_SOFT;

hspi5.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_4;

hspi5.Init.FirstBit = SPI_FIRSTBIT_MSB;

hspi5.Init.TIMode = SPI_TIMODE_DISABLE;

hspi5.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;

hspi5.Init.CRCPolynomial = 0x0;

hspi5.Init.NSSPMode = SPI_NSS_PULSE_ENABLE;

hspi5.Init.NSSPolarity = SPI_NSS_POLARITY_LOW;

hspi5.Init.FifoThreshold = SPI_FIFO_THRESHOLD_01DATA;

hspi5.Init.TxCRCInitializationPattern = SPI_CRC_INITIALIZATION_ALL_ZERO_PATTERN;

hspi5.Init.RxCRCInitializationPattern = SPI_CRC_INITIALIZATION_ALL_ZERO_PATTERN;

hspi5.Init.MasterSSIdleness = SPI_MASTER_SS_IDLENESS_00CYCLE;

hspi5.Init.MasterInterDataIdleness = SPI_MASTER_INTERDATA_IDLENESS_00CYCLE;

hspi5.Init.MasterReceiverAutoSusp = SPI_MASTER_RX_AUTOSUSP_DISABLE;

hspi5.Init.MasterKeepIOState = SPI_MASTER_KEEP_IO_STATE_DISABLE;

hspi5.Init.IOSwap = SPI_IO_SWAP_DISABLE;

if (HAL_SPI_Init(&hspi5) != HAL_OK)

{

Error_Handler();

}

/* USER CODE BEGIN SPI5_Init 2 */

/* USER CODE END SPI5_Init 2 */

}

dac function

void write_dac80501(uint8_t command, uint16_t value)

{

uint8_t send_data[3] = {0x00};

send_data[0] = command;

send_data[1] = (value >> 8) & 0xFF;

send_data[2] = value & 0xFF;

HAL_GPIO_WritePin(SPI5_CS_PIN_GPIO_Port, SPI5_CS_PIN_Pin, GPIO_PIN_SET);

HAL_Delay(1);

HAL_GPIO_WritePin(SPI5_CS_PIN_GPIO_Port, SPI5_CS_PIN_Pin, GPIO_PIN_RESET);

if(HAL_SPI_Transmit(&hspi5, send_data, 3, HAL_MAX_DELAY) != HAL_OK)

{

Error_Handler();

}

HAL_GPIO_WritePin(SPI5_CS_PIN_GPIO_Port, GPIO_PIN_6, GPIO_PIN_SET);

}

Pin connection

please help.

  • Hello, 

    The REF-DIV setting is a common culprit for the output not updating, but you have set this to 1 (div by 2), so this should be fine. 

    It looks like you have the SPI mode setup correctly to shift data on the rising edge and capture on the falling edge. 

    You can remove the jumpers on J5, J8, and J11, or place a jumper on J1 to disable the FTDI level shifters. As of now you have your external SPI signals connected to the FTDI level shifters (see EVM schematic). If you are using the DAC80501, make sure the CS jumper is closed on J13 (hard to see in your picture if that is the case). 

    Can you measure one of your SPI writes on a scope and share a screenshot so I can verify the format and timings? 

    Best,

    Katlynne Jones

  • Thanks for the reply, i followed your previous reply regarding same dac80501 issue, it got solved, main culprit was clock phase which i was previously giving to 1edge, i changed it to 2edge, it worked.