i'm trying to use dac7760 with STM32f1 and this is my schematic
I use the following function to send data from STM32f1 to a DAC7760:
static HAL_StatusTypeDef WriteSingle_DAC7760(uint8_t ch_Addr, uint16_t ch_Data){ uint8_t liv_Data[3]; // 0: ch_Addr 1:ch_Datadata?8? 2:ch_Datadata?8? uint8_t liv_RXData[3] = {0}; liv_Data[0] = ch_Addr; liv_Data[1] = (ch_Data & 0xff00) >> 8; liv_Data[2] = ch_Data & 0x00ff; status = HAL_SPI_TransmitReceive(&hspi2, liv_Data, liv_RXData, 3, 500); HAL_GPIO_WritePin(GPIOA, GPIO_PIN_3, GPIO_PIN_SET); HAL_GPIO_WritePin(GPIOA, GPIO_PIN_3, GPIO_PIN_RESET); HAL_Delay(1); return status; }
I use this initial settings for DAC7760
//Write reset register WriteSingle_DAC7760(0x56, 0x0001); //Write control register 1001 0000 0000 0001 WriteSingle_DAC7760(0x55, 0x9001); //configuration register 0000 0011 0000 0000 WriteSingle_DAC7760(0x57,0x0300); WriteSingle_DAC7760(0x01,32000);
there is no output on current output and voltage output. Am I missing a part or did I do something wrong?