Your solution worked! Thanks a lot! I only added a filter to the input because my signal gets a bit noisy in the high rpm range. There was a caveat though. I'm using the STM8S discovery board and I hadn't noticed that TIMER1 Channel1 and 3 is occupied by the Touch sensing button. So I spent some hours checking and checking before I found that I could not put decent signals on those channels... and then I saw it... Haha If only I could buy you a beer now :) Klaas