Skip to main content
ABetz.1
Associate
January 26, 2023
Solved

DAC reaches maximum output voltage before the maximum value is written into the register.

  • January 26, 2023
  • 1 reply
  • 860 views

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!

0693W00000Y9DmIQAV.jpg0693W00000Y9DmHQAV.jpg

This topic has been closed for replies.
Best answer by ABetz.1

The problem was Vref on my board.

The TL1431CL5T should deliver a 2.5 V reference Voltage but on my board it was 4.8V.

I simply changed the jumper JP8 to select VDD as Vref and it works perfectly fine now.

1 reply

ABetz.1
ABetz.1AuthorBest answer
Associate
January 27, 2023

The problem was Vref on my board.

The TL1431CL5T should deliver a 2.5 V reference Voltage but on my board it was 4.8V.

I simply changed the jumper JP8 to select VDD as Vref and it works perfectly fine now.