Timer2 ATMEGA328P Problem

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
ChrisT66
Posts: 67
Joined: Mon Jul 13, 2020 3:00 pm
Contact:

Timer2 ATMEGA328P Problem

Post 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

viktor_au
Posts: 342
Joined: Fri Jan 26, 2018 12:30 pm
Location: South Australia
Has thanked: 44 times
Been thanked: 60 times
Contact:

Re: Timer2 ATMEGA328P Problem

Post 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?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Timer2 ATMEGA328P Problem

Post 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.

Post Reply