DAC reaches maximum output voltage before the maximum value is written into the register.
Hi,
I'm using a NUCLEO-G491 board with a G491RET6 MCU.
To test the DAC, I created a Triangle signal by incrementing a variable and writing it to the DHR12R register. However the top of the Triangle is cut-off and the maximum voltage on the Pin is 3.45 V. I'm using the Pin A4 (with the Buffer enabled) which was only connected to an Oscilloscope. The same happens with a sawtooth signal.
bool rampUp = true;
uint16_t value_dc=0;
while(1)
{
if (rampUp == true)
{
DAC -> DHR12R1 = (value_dc & 0x0FFF);
value_dc++;
if (value_dc == 4095)
{
rampUp = false;
}
}
else
{
DAC -> DHR12R1 = (value_dc & 0x0FFF);
value_dc--;
if (value_dc == 0)
{
rampUp = true;
}
}
}I also tried the on-board Triangle-wave generation, but the same thing happens.
I changed manually the values and measured the voltages with a voltmeter. The voltage increased until the value 3100 and didn't change any more after this.
I also tried:
- Output Buffer Enabled / Disabled
- Delay between writing into the registers
- 10k Resistor between Pin A4 and GND
- Using 8-Bit register
- HAL Library functions
Is there something else I could try?
Thank you in advance!

