Question
Timer 1 overflow interrupt not triggered
Hello,
I stated using the STM8f003 uC.
For simple start I want to implement a flashing LED using the TIMER1 overflow interrupt
of the core. The code does compile and can be flash without problems.
Sadly the LED never lights up -> the interrupt is not even triggered once.
Does somebody have an idea?
Thanks :)
#include "stm8.h"
#define F_CPU 1000000
#define PRE_SCALE 0xF42400
void timer_isr() __interrupt(11){
PD_ODR = 0xff;
TIM1_SR1 &= ~(1 << TIM_SR1_UIF); // Clear interrupt flag
}
void main(){
CLK_PCKENR1 = (1<<7);
TIM1_PSCRH = 0;
TIM1_PSCRL = 15;
TIM1_IER = TIM_IER_UIE;
TIM1_CR1 = TIM_CR1_CEN;
__asm__("rim");
PD_DDR = 0xff;
PD_CR1 = 0xff;
PD_ODR = 0x00;
while(1);
}