Question
DAC can't output 0V
Posted on February 19, 2015 at 07:41
I'm using stm32f429 discovery board. I have configured DAC Channel 1 (PA4) for DAC ouput.
When I try to configure ouput in the range of 0.15v - Vref(2.97v) I'm getting the ouput properly, but when trying to output 0v it's still showing 0.12 (measured using multimeter) In fact I cant get a voltage below 0.12 V, is this behaviour expected .. I dont think this is an issue with my code any way I'm posting code alongwith What might be causing this offset voltage?GPIO_InitTypeDef GPIO_InitStructure;
DAC_InitTypeDef DAC_InitStructure; RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD, ENABLE); RCC_APB1PeriphClockCmd(RCC_APB1Periph_DAC, ENABLE); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AN; GPIO_Init(GPIOA, &GPIO_InitStructure);DAC_InitStructure.DAC_Trigger=DAC_Trigger_None;
DAC_InitStructure.DAC_WaveGeneration=DAC_WaveGeneration_None; DAC_InitStructure.DAC_LFSRUnmask_TriangleAmplitude=DAC_LFSRUnmask_Bit0; DAC_InitStructure.DAC_OutputBuffer=DAC_OutputBuffer_Enable; DAC_Init(DAC_Channel_1,&DAC_InitStructure); DAC_Cmd(DAC_Channel_1, ENABLE); while(1) { DAC_SetChannel1Data(DAC_Align_12b_R, 868); //ouput .7v ((2.97 * 868) / 4095)= 0.7v delay_milliseconds(5000); // MY custom API for delay 5seconds DAC_SetChannel1Data(DAC_Align_12b_R, 0); //expects output of 0v but gets 0.12v delay_milliseconds(5000); // MY custom API for delay 5seconds } #dac #stm32 #!stm32f4-disco