Hello @meriarajagukguk
For ADC config:
- Resolution: 12-bit
- Scan Conversion Mode: Disabled
- Continuous Conversion Mode: Enabled
- External Trigger Conversion: Software Start
- Data Alignment: Right
For DAC config:
- Trigger: None
- Output Buffer: Enabled
In your while (1), you should set the DAC output to the ADC value
while (1)
{
// Poll for ADC conversion completion
if (HAL_ADC_PollForConversion(&hadc1, HAL_MAX_DELAY) == HAL_OK)
{
// Read the ADC converted value
uint32_t adcValue = HAL_ADC_GetValue(&hadc1);
// Set the DAC output to the ADC value
HAL_DAC_SetValue(&hdac, DAC_CHANNEL_1, DAC_ALIGN_12B_R, adcValue);
}
}