2008-05-28 02:30 AM
don't used ADC interrupt by EOC
2011-05-17 03:35 AM
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.