Wrong Arduino UNO Timer0 configuration on 8bit-era.cz

As I was playing around with my Arduino UNO, it so happened that I needed to use the Timer0 to generate an interrupt at 100Hz.

So to save me time and the trouble of searching which bits to set in the datasheet, I went straight to my browser and searched "arduino uno timer interrupt calculator", which gave me as first result this website: www.8bit-era.cz
I copy/pasted the code generated for the Timer0 and it obviously didn't work as expected. So after searching a bit, it seems that the bit WGM01 that sets the waveform generation mode was set in the TCCR0B register instead of the TCCR0A one, as it should have been.

As I couldn't find this particular issue on the forum, and in the hope of helping a few people to not lose their time like I did, I can recommend this generator, which seems to be exempt of mistakes.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.