cancel
Showing results for 
Search instead for 
Did you mean: 

don't used ADC interrupt by EOC

num_namol
Associate
Posted on May 28, 2008 at 11:30

don't used ADC interrupt by EOC

1 REPLY 1
num_namol
Associate
Posted on May 17, 2011 at 12:35

I don't used ADC interrupt by EOC flag. How to set register?

my program is

#include // Include STM32 header file

int adc_val=0;

void ADC_IRQHandler(void)

{

if(ADC1->SR & 0x02)

{

adc_val = ADC1->DR;

GPIOC->ODR ^= (1<

}

}

void adc_setup()

{

RCC->APB2ENR |=(1<

GPIOC->CRL &= (0xFFF0FFFF); // Clear bit CNF4[1:0]=00,

// MODE4[1:0]=00==> Input Analog

// Set PC4 Input Analog mode

ADC1->SMPR1 |= (0x03<

ADC1->CR1 |= (1<

ADC1->CR2 |= 0x01; // Set bit ADON at first time

ADC1->CR2 |=(1<

while(ADC1->CR2 &(1<

ADC1->CR2 |=(1<

while(ADC1->CR2 &(1<

}

int main()

{

while(1)

{

ADC1->SQR3 &= 0xE0; // Ensure Clear old channel

ADC1->SQR3 |= 14; // Set channel

ADC1->CR2 |= 0x01; // Set bit ADON

..................

..................

}

}

my program is not jump to ISR ADC_IRQHandler when EOC bit is set some one help me answer how to set it.