Support for tone() on ATTiny841 - documentation issue or misunderstanding? #893
Simulators
started this conversation in
Support / Q & A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am using the ATtiny841 and ATTiny core 1.5.2, and I am confused about tone() support.
The README says "on 841/441, in version 1.1.6 and later, tone() is on Timer2", and ATtiny_x41.md says "The standard Tone() function is supported on these parts. For best results, use PA5 (pin 5 on either pinout) or PA6 (pin 4 on counterclockwise, pin 6 on clockwise), as this will use hardware output compare to generate the square wave, instead of interrupts."
I'm having some trouble navigating the code, but I would have expected that the direct drive pins for Timer2 would be OC2A & OC2B. However the accompanying pinout diagram for the '841 shows PA5/PA6 as OC0B & OC1A respectively. OC2A/OC2B would be PB7 & PA7.
Before I commit something to copper, is the documentation correct, or is there an error? Regardless of whether I use PA5/PA6, or PB7/PA7, for tone(), I see lots of interrupts being generated when tone() is active.
I realise that 1.5.2 is the older core, and 2.0.0 is the development focus, but the 2.0.0 documentation says the same.
(ETA: tone() does actually work, whatever pins I use.)
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions