I have one more question. How can I make biphasic signal as sharp rising and falling edge? In my signal which is attached, there is a little ramp 0 to positive and positive to negative changing?
Here is my code:
// DAC Conversion
// Output A of the DAC
HAL_GPIO_WritePin(DAC_SYNC_GPIO_Port, DAC_SYNC_Pin, GPIO_PIN_RESET);
DACA_Buf = DAC_A_Write<<12 | testdata_out<<4;
HAL_SPI_Transmit(&hspi2,(uint8_t*)&DACA_Buf,16,100);
HAL_GPIO_WritePin(DAC_SYNC_GPIO_Port, DAC_SYNC_Pin, GPIO_PIN_SET);
// Output B of the DAC
HAL_GPIO_WritePin(DAC_SYNC_GPIO_Port, DAC_SYNC_Pin, GPIO_PIN_RESET);
DACB_Buf = DAC_B_Write<<12 | testdata_out<<4;
HAL_SPI_Transmit(&hspi2,(uint8_t*)&DACB_Buf,16,100);
HAL_GPIO_WritePin(DAC_SYNC_GPIO_Port, DAC_SYNC_Pin, GPIO_PIN_SET);
// Switch 1st for supplying square signals to the inverting input of the Opamp
HAL_GPIO_WritePin(SW_1st_GPIO_Port, SW_1st_Pin, GPIO_PIN_SET);
DWT_Delay_us(100);
HAL_GPIO_WritePin(SW_1st_GPIO_Port, SW_1st_Pin, GPIO_PIN_RESET);
// Switch 2nd for supplying square signals to the noninverting input of the Opamp
DWT_Delay_us(40);
HAL_GPIO_WritePin(SW_2nd_GPIO_Port, SW_2nd_Pin, GPIO_PIN_SET);
DWT_Delay_us(100);
HAL_GPIO_WritePin(SW_2nd_GPIO_Port, SW_2nd_Pin, GPIO_PIN_RESET);