Page 1 of 1

Timer2 ATMEGA328P Problem

Posted: Mon Dec 21, 2020 6:49 pm
by ChrisT66
Timer2 on ATMEGA328p does not work properly in Flowcode. Or the prescaler does not fit.
Have again several hours puzzled where the problem lies... then I remembered that already Martin has recognized the problem with the Timer2.
The value set in the prescaler does not fit. Can this be corrected in Flowcode?

Greetings Christian

Re: Timer2 ATMEGA328P Problem

Posted: Mon Dec 21, 2020 9:59 pm
by viktor_au
Hello Christian

That is what Ben asked me when I have risen the same question:

When compiling do you get a warning that the period register is unavailable on the device?

Re: Timer2 ATMEGA328P Problem

Posted: Tue Dec 22, 2020 12:27 pm
by Benj
Hi Christian,

Yes Viktor is correct the ATMEGA328p lacks the period register and so the period is locked to 256 counts. There is a warning about this in the compiler messages but it's easy to miss.