cancel
Showing results for 
Search instead for 
Did you mean: 

DAC offset problem

spa23
Associate III
Posted on October 18, 2013 at 09:50

HI

I have a small issue with the DAC in a stm32F103, there Is a small offset between DAC_DHR12R1 and DAC_DOR1 registers

The code is pretty simple:

DAC_InitStructure.DAC_Trigger = DAC_Trigger_Software;

DAC_InitStructure.DAC_WaveGeneration = DAC_WaveGeneration_None;

DAC_InitStructure.DAC_OutputBuffer = DAC_OutputBuffer_Enable;

DAC_Init( DAC_Channel_1, &DAC_InitStructure );

DAC_SetChannel1Data( DAC_Align_12b_R, value );

DAC_SoftwareTriggerCmd(DAC_Channel_1, ENABLE);

And the test result:

DAC_DHR12R1 DAC_DOR1

40 41

409 411

1023 1026

2047 2051

3071 3076

4095 5

Has anyone else seen the same problem?

Another thing is that I can�t get it to work with DAC_Trigger_None. any ideas?

#dac
2 REPLIES 2
Amel NASRI
ST Employee
Posted on October 22, 2013 at 11:40

Hi Panduro,

Isn't the commande enabling the DAC Channel1 missed?

DAC_Cmd(DAC_Channel_1, ENABLE);

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

spa23
Associate III
Posted on October 23, 2013 at 09:42

Yes, (copy paste error) I have it in my code.