2009-08-07 05:20 PM
Help,can not enter into adc1 interrupt of stm8s105c4t6
2011-05-17 06:03 AM
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! chris2011-05-17 06:03 AM
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 mozra2011-05-17 06:04 AM
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.