SpenceKonde / ATTinyCore

Arduino core for ATtiny 1634, 828, x313, x4, x41, x5, x61, x7 and x8
Other
1.59k stars 308 forks source link

Which Timers Used #211

Closed CraigMarkwardt closed 6 years ago

CraigMarkwardt commented 6 years ago

Hi, great project, thanks! Your documentation is really nice, but what I'd like to know is which timers are being used. In this case, I would like to use Timer1 on ATTiny85 (which I am aware is an odd duck), but it would be nice to have documented which Timers are occupied by the core. Thanks.

SpenceKonde commented 6 years ago

All of the ATTinyCore boards should use Timer0 for millis and Timer1 for Tone (ATTiny841/441 should probably be changed to use Timer2, so that Tone can be used on them without interfering with other libraries that use Timer1 - The 841 has two identical 16-bit timers)

You can freely use Timer1 on the ATTiny85 - out of the box it is configured for PWM as shown on the pinout chart, but that's all that's done to Timer1 on the Tiny85. I agree that Timer1 on the attiny85 is one of it's most interesting features, and I'm happy to say that you can use it without trashing millis()/delay()/etc.

Documentation will be amended in time for the next release to clarify this.

CraigMarkwardt commented 6 years ago

Thanks!

SpenceKonde commented 6 years ago

Moved tone() to timer2 on the 841/441 while I was looking at this, so that you can use Servo/TimerOne/etc at the same time as tone() on those devices.