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
Timer2 ATMEGA328P Problem
Moderator: Benj
-
- Posts: 343
- Joined: Fri Jan 26, 2018 12:30 pm
- Location: South Australia
- Has thanked: 44 times
- Been thanked: 60 times
- Contact:
Re: Timer2 ATMEGA328P Problem
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?
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?
- 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
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel