DAC outputs are weird ...
Hi, I am trying to get DAC work on Nucleo-L432KC board, DAC 1 is activated, output on Pin PA4, normal mode, output buffer enabled, software trigger, no wave generation, and LL driver. I use LL_DAC_ConvertData12RightAligned or WRITE_REG(DACx->DHR12R1, dac_data) to write the dac output data with the voltages measured on PA4:
dac_data=0, VPA4=0.041V
dac_data=409, VPA4=2.992V
dac_data=819, VPA4=2.659V
dac_data=1228, VPA4=2.328V
dac_data=1638, VPA4=1.996V
dac_data=2047, VPA4=1.664V
dac_data=2457, VPA4=1.332V
dac_data=2866, VPA4=1.000V
dac_data=3276, VPA4=0.668V
dac_data=3685, VPA4=0.336V
dac_data=4095, VPA4=0.041V
dac_data=0,, VPA4=0.041VVREF = VDDA = 3.323V. The data is 1/10th incremental from 0 to VDDA. I expected to see same increment on output voltage. However, it is backward from near VDDA (actually 2.992V, 9/10 of VDDA) to 0V. The output is reversed. It is also weird that the output is 0.041V when dac_data is 0 (if the dac is reversed, I expected to see near VDDA when dac_data=0). Any help is appreciated. -wq
