Question
STM32f100 DAC wrong Behavior
Posted on October 27, 2014 at 19:20
Hi guys,
I´m having some difficulties getting the DAC working properly with the STM32F100 LQFP48pins.First of all, Reference Manual says the followingOn 64-pin packages and packages with less pinsThe VREF+ and VREF- pins are not available, they are internally connected to the ADCvoltage supply (VDDA) and ground (VSSA).I´ve in my PCB VDDA connected to 3,3v.11.3.5 DAC output voltageDigital inputs are converted to output voltages on a linear conversion between 0 and VREF+.The analog output voltages on each DAC channel pin are determined by the followingequation:DACoutput=VREF*DOR/4095Mi code is the following; GPIO_InitStruct.GPIO_Pin = GPIO_Pin_4; //GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AIN; GPIO_Init(GPIOA_BASE, &GPIO_InitStruct); // DAC channel1 Configuration DAC_StructInit(&DAC_InitStruct); DAC_InitStruct.DAC_Trigger = DAC_Trigger_None; DAC_InitStruct.DAC_WaveGeneration = DAC_WaveGeneration_None; DAC_InitStruct.DAC_OutputBuffer = DAC_OutputBuffer_Disable; DAC_Init(xDACTable[DAC1].eDAC_Channel, &DAC_InitStruct);DAC_Cmd(DAC_Channel_1, ENABLE);DAC_SetChannel1Data(DAC_Align_12b_R, 0x0FFF);DAC_SoftwareTriggerCmd(DAC_Channel_1, ENABLE);Loading in DAC DOR register the Value =4095 I only get 2,5v instead of 3,3v Anyone knows why am I doing wrong?