cancel
Showing results for 
Search instead for 
Did you mean: 

Help,can not enter into adc1 interrupt of stm8s105c4t6

cgha21
Associate II
Posted on August 08, 2009 at 02:20

Help,can not enter into adc1 interrupt of stm8s105c4t6

3 REPLIES 3
cgha21
Associate II
Posted on May 17, 2011 at 15:03

Hello,Everyone:

The ADC Init is like this:

CLK_PCKENR2 |=0x08;

ADC_CSR = 0x05; //ch0~ch5

ADC_CR1 = 0x22; //f/4,CONT convertion

ADC_CR2 = 0x08; //ALIGN right,scan mode

//ADC_CR3 = 0x80; //enable data buff

ADC_TDRL = 0xff; //disable the smitt of ch0~ch7

ADC_CSR |= 0x20; //enable eoc int,

ADC_CR1 |=0x01; //start convertion

but the simulation using stlink can not enter into adc1 Interrupt handler,why? Can someone here help me, I'm using stvd4.12 and cosmic 16k verstion,thanks!

chris

mozra27
Associate II
Posted on May 17, 2011 at 15:03

Hi Chris,

I think that you have missed to enable the general interrupt.

Can you verify that this line exist in your code: _asm(''rim\n'');

Regards

mozra

cgha21
Associate II
Posted on May 17, 2011 at 15:04

Thanks for your reply,but the reason is that i should set the adon bit twice,one for waking up,the other one for starting convertion.