2014-07-14 03:19 AM
Hello,
I have a trouble with my DAC, for example when I set the DAC output (Channel1 orChannel2) to the maximum voltage, the DAC generate the minimum voltage:DAC_SetChannel1Data(DAC_Align_12b_R, 4095);
Vout
~
0VDAC_SetChannel1Data(DAC_Align_12b_R, 0);
Vout
~
3.3VDAC_SetChannel1Data(DAC_Align_12b_R, 1000);
Vout
~
0.8V The strange thing is, I have two test boards, and the problem happens only on one board. The other board have a correct behavior, with the same project! Do you have any ideas? Thanks a lot!DAC_SetChannel1Data(DAC_Align_12b_R, 4095);
Vout
~
0VDAC_SetChannel1Data(DAC_Align_12b_R, 4095);
Vout
~
0V #whiskey-tango-foxtrot #oscar-mike-golf2014-07-15 05:54 AM
If your 'problematic' board and the reference board are identical in both software and hardware...
Yes they are! :)Have you tried the other DAC channel/output instead, does it behave the same way ?Yes, the Channel 2 is inverted, like the Channel 1. They have the same behavior. This enhances the strangeness of the problem.
2014-07-15 06:26 AM
Try using DAC_StructInit()
2014-07-15 07:39 AM
Try using DAC_StructInit()
Actualy I already use this command:DAC_InitTypeDef DAC_InitStructure;
...
DAC_InitStructure.DAC_Trigger = DAC_Trigger_None;
DAC_InitStructure.DAC_WaveGeneration = DAC_WaveGeneration_None;
DAC_InitStructure.DAC_OutputBuffer = DAC_OutputBuffer_Enable;
DAC_StructInit(&DAC_InitStructure);
2014-07-15 08:00 AM
DAC_InitTypeDef DAC_InitStructure;
DAC_StructInit(&DAC_InitStructure); // Clear up structure
DAC_InitStructure.DAC_Trigger = DAC_Trigger_None;
DAC_InitStructure.DAC_WaveGeneration = DAC_WaveGeneration_None;
DAC_InitStructure.DAC_OutputBuffer = DAC_OutputBuffer_Enable;
DAC_Init(DAC_Channel_1, &DAC_InitStructure); // Initialize the channel
2014-07-15 08:27 AM
It was my first code implementation, it doesn't change anything...
I will assemble some new boards during the next month, maybe I will try to do some destructive tests directly on DAC outputs pins to check if this problem appears again.
2014-07-16 12:45 AM
Configure your DAC output pin as a GPIO push pull output. Clear the pin and check if you get 0V or a high voltage from your circuit's output. Set the pin and check if you get 0V or a high voltage from your circuit's output. This will tell you if it's your hardware at fault.
Check your measuring device too by probing 0V and the +3V3 supply.2014-07-17 07:43 AM
Configure your DAC output pin as a GPIO push pull output. Clear the pin and check if you get 0V or a high voltage from your circuit's output.
Hi John, I configured my DAC outputs (PA3, PA4) as push-pull outputs GPIOs.- When I Set the pin, output voltage is high (3,3V)- When I Reset the pin, output voltage is low (0V)-> There is no hardware fault when the pins are not configured as analog outputs... (and yes, my mesuring devices are OK, I can probe the 0V, 3.3V and 5V on my board).
2015-03-23 12:17 AM
Hi Prieur,
How are your new boards? Does the problem appear again? I have met the same problem that the DAC output for one board is okay and inverted on the other board.2015-06-01 09:55 AM
Hi,
Yes the problem is still here on my board, but I builded other boards and the problem is never appeared again...Did you solve your problem?2015-06-01 01:32 PM
Looking at the original post:
> DAC_SetChannel1Data(DAC_Align_12b_R, 1000);
> Vout
~
0.8V Doesn't this sound about right? JWDAC_SetChannel1Data(DAC_Align_12b_R, 4095);
Vout
~
0VDAC_SetChannel1Data(DAC_Align_12b_R, 4095);
Vout
~
0V