Arduino
Arduino copied to clipboard
8Mhz Atmel 328 timing issue
Hi, I am running a Atmel328 on 8Mhz and am using the SetPinFrequencySafe(pin,freq) function.
It shows some quite interesting behaviour. I start with freq = 100, it outputs PWM 100Hz as wished, than I read out / send the freq variable and that one shows 50! Excactly half! But since the program runs as loop I would expect the frequency to drop, but it does not ?! So I wonder if the 8Mhz mode may cause some trouble or if i have a major bug somewhere?
For my application I just multiply every reading from the variable by two. but it feels really strange and wrong