khoih-prog / TimerInterrupt

This library enables you to use Interrupt from Hardware Timers on an Arduino, such as Nano, UNO, Mega, etc. It now supports 16 ISR-based timers, while consuming only 1 hardware Timer. Timers' interval is very long (ulong millisecs). The most important feature is they're ISR-based timers. Therefore, their executions are not blocked by bad-behaving functions or tasks. This important feature is absolutely necessary for mission-critical tasks.
MIT License
98 stars 11 forks source link

Timer3/4 in Arduino Micro board #18

Closed joonghochoe closed 3 years ago

joonghochoe commented 3 years ago

Is your feature request related to a problem? Please describe.

In Atmega32u4 datasheet, 16 bit Timer3 and 10 bit Timer4 can be used. But in your TimerInterrupt code, Timer3 and 4 is disabled for ATMEGA_32U4. Is there a reason to disable it?

Describe the solution you'd like

I am working on a project using Timer3 from Arduino Micro. Just now, I am using Timer 3 by modifying the code, but is there any reason not to use it?

khoih-prog commented 3 years ago

Thanks for your interest in the library.

I'll definitely have a look and add to the library.

1, 16-bit Timers/Counters (Timer/Counter3) similar to Timer/Counter1. Much easier.

  1. 10-bit High Speed Timer/Counter4. Requiring some small work and test.

There is no good reason at all, just something just slipping out of my mind when I did this.

khoih-prog commented 3 years ago

I'd appreciate it if you could help create a PR for this to save me some time. I'll help on the way if you need it.

khoih-prog commented 3 years ago

Hi @joonghochoe

Thanks for your enhancement request, the new TimerInterrupt release v1.5.0 has just been published, with your Contribution noted in Contributions and Thanks.

Please help do some rigorous tests on Timer3 and Timer4 for ATmega32u4 and ATmega16u4 as I currently have no such boards to test yet

Looking forward to receiving more Contributions from you.

Thanks and Regards,


Releases v1.5.0

  1. Add Timer3 and Timer4 support to ATmega32U4 and ATmega16U4.
  2. Add Timer auto-selection to examples.
joonghochoe commented 3 years ago

When I used version 1.5.0, Timer 3 worked fine. Thanks.

khoih-prog commented 3 years ago

Good news. If you have time, could you please help testing Timer4. Thanks.