# Problem with adc of stm32f051

#### Mousivandhossein

Joined Dec 8, 2020
25
Hi,
Happy new year

I want to use adc of stm32f051c8t6, but my code did not work correctly.
Code:
int main()
{

RCC->APB1ENR |=RCC_APB1ENR_DACEN;
DAC->CR |=DAC_CR_EN1;

while(1)
{
for(int j=0;j<2000000;j++)j=j;
}
}
I use adc channel 0 to read the voltage, but the result is zero.