Simple DAC application to generate Voltage on pin
I am using stm32f407g.
I wrote this simple code which (in theory) should give on pin PA4 the voltage set in "DACout_v" (in this case I set 2.8V)
Following this document (the section "Digital sine waveform pattern preparation") I derived DOR and then gave it to "HAL_DAC_SetValue".
With te oscilloscope I measure 2.60V. Why? I would like to understand what I am doing wrong.
float DACout_v = 2.8; //outside the main
while (1) {
DACout_d = DACout_v*(0xfff)/3.3; //DOR
HAL_DAC_SetValue(&hdac, DAC_CHANNEL_1, DAC_ALIGN_12B_R, DACout_d);
}
Thank you.
