Hello, I am using stm8s003f3 and I wanted to count with 1 ms of precision and it works well.
I use a prescaler of 128 and a period of 125 and if I use my delay function with 1000 as parameter, I get the second.
However if I use a prescaler of 16 and period of 1, normally I get 1 µs precision but my delay function with 1000000 is logically 1 second too but it's +- 7s
I don't know what I'm doing wrong so if someone can help me.
My main.c http://pastebin.com/TgheG5gf