cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with ADC Interrupt: it happens only one time

rastaxe
Associate II
Posted on January 18, 2008 at 07:25

Problem with ADC Interrupt: it happens only one time

4 REPLIES 4
rastaxe
Associate II
Posted on May 17, 2011 at 09:49

I have a problem with ADC Interrupt. The interrupt happens only one time.

This is my code for interrupt:

Code:

void ADC_IRQHandler(void){

/* Clear the end of conversion flag */

ADC_ClearFlag(ADC_FLAG_ECV);

GPIO_WriteBit(GPIO6, GPIO_Pin_7, (BitAction) (1-GPIO_ReadBit(GPIO6, GPIO_Pin_7)));

delay(0xFFF);

GPIO_WriteBit(GPIO6, GPIO_Pin_0, (BitAction) (1-GPIO_ReadBit(GPIO6, GPIO_Pin_0)));

}

Leds number 7 and 0 turn on, but they don't blink.

What's the problem? My code is the same of the ST Example.

I put entirely my code in attach.

Thanks.

najoua
Associate II
Posted on May 17, 2011 at 09:49

Hello,

I tested your code on our board and it works fine.

Could you please tell me which STR91x revision you are using?

What is the cystal frequency you are using?

Regards,

Najoua.

rastaxe
Associate II
Posted on May 17, 2011 at 09:49

Thanks for your answer!

I'm using STR912FW44.

I don't know the crystal frequency.

On this board I have wrote other programs that use interrupts like CAN, UART, TIM and they work fine.

I don't know where is the problem with ADC's interrupt, but without interrupt the program works well.

Thanks for your interest.

Best Regards.

jilisegiar
Associate II
Posted on May 17, 2011 at 09:49

which tool chain you are using?