This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

unable to use adc1 in interrupt mode in stm32fx103rbt6

Hi, i am unable to use the adc in interrupt mode. following is the adc intialisation i have done. I am using adc 1 channel 14. I have added a IRQ handler :
/////////////////////////////////////////////////// void ADC_IRQHandler (void){ //fetch the value dataReg = (UNSIGNED16)ADC1->DR; dataReg++;

}
///////////////////////////////////////////////////

void adc_Init (void) {

// ptr = ADC_IRQHandler; RCC->APB2ENR |= (1<<9); /* enable periperal clock for ADC1 */

ADC1->SQR1 = 0x00000000; /* 1 conversions */ //ADC1->SQR1 |= 14<<5; ADC1->SQR3 = 14<<0;//(3<<10) | (2<<5) | (1<<0); /* set order to chn14 */ ADC1->SMPR2 = (5<< 9) | (5<<6) | (5<<3); /* set sample time (55,5 cycles) */

ADC1->CR1 = 0x00000100; /* use independant mode, SCAN mode */ ADC1->CR1 |= 1<<5; /* enable end of conversion interrupt */ ADC1->CR2 = 0x000E0000; /* data align right, cont. conversion */ ADC1->CR2 |= 0x0000001; /* data align right, cont. conversion */ /* EXTSEL = SWSTART */ /* enable ADC, No DMA mode */ ADC1->CR2 |= 0x00500000; /* start SW conversion */ }

///////////////////////
The entry of this IRQ is present in the stm32f10x.s file. when EOC bit gets set in the simulator my IRQ function does not get called.
Has any body used this functionality, if you have a sample project can you please mail it to me . my mail id is rohitd@kpitcummins.com .
we are using stm32fx103rbt6 processor.

thanks and regards
rohit

Parents
  • (Sorry for my bad English ability.)

    Hi rohit,

    Though, Andy Neil's responses are usually forthright and unsparing,
    but his responses are really helpful.

    From my understanding, Andy is a very good person, he is more than
    willing to help people.

    We all come from different countries and cultures, so that, We need
    more patience and tolerance, I believe.

    "Much of what looks like rudeness, is not intended to give offense.
    Rather, it's the product of the direct, cut-through-the-courtesy
    communications style that is natural to people who are more concerned
    about solving problems than making others feel warm and fuzzy."

    And I know that Andy did already provide help to you.

    So, why don't you just tell us something about the samples provided
    by Keil and ST; and show your NVIC source code?

    Please rohit.

Reply
  • (Sorry for my bad English ability.)

    Hi rohit,

    Though, Andy Neil's responses are usually forthright and unsparing,
    but his responses are really helpful.

    From my understanding, Andy is a very good person, he is more than
    willing to help people.

    We all come from different countries and cultures, so that, We need
    more patience and tolerance, I believe.

    "Much of what looks like rudeness, is not intended to give offense.
    Rather, it's the product of the direct, cut-through-the-courtesy
    communications style that is natural to people who are more concerned
    about solving problems than making others feel warm and fuzzy."

    And I know that Andy did already provide help to you.

    So, why don't you just tell us something about the samples provided
    by Keil and ST; and show your NVIC source code?

    Please rohit.

Children
No data