Dear Forum members,
I tried to count an external square wave on ETR pin PD3 using external clock mode2 on STM8S103F3 chip. The timer1 counter always show 0. I followed the RM0016 manual to set up the external clock 2 but was unsuccessful. If any members have successfully counted using ETR as external clock kindly advice. below is the code I used
mov CLK_CKDIVR,#$0 ; set max internal clock 16mhz
bset TIM1_ETR,#6 ; External clock mode 2 enabled
bset TIM1_CR1,#0 ; enable timer1