2023-01-26 02:35 AM
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:
Is there something else I could try?
Thank you in advance!
Solved! Go to Solution.
2023-01-27 05:24 AM
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.
2023-01-27 05:24 AM
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.