Hello everyone,
I have been encountering an odd issue with the TONE() function on the ATTINY861 Micro. This question is mostly directed towards Dr.Azzy as I am utilizing his core, "ATTinyCore V1.2.3" on Arduino 1.8.8. First and foremost, this is the code I tried and is producing my observed results:
const uint8_t out = 8;
void setup() {
// put your setup code here, to run once:
pinMode(out, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
tone(out, 15000);
delay(2000);
}
If I put in the desired frequency as 10000hz I get 2000hz measured on my scope, this is with a Timer 1 clock at 8mhz, at 64mhz the reading is 250hz ~ /8 which makes sense. From what I read I understood that there was a lower hardware limitation around 16hz @ 8mhz F_CPU for the Tone library. As to the upper limit, I thought I read it was well above my 10000hz target. Is this a bug due to the odd timer for this particular core? It would be nice to utilize this approach versus putting together a hardware timer manually.
If anyone has had a similar experience with the tone function, or if it is a known limitation please let me know.
Any input / advice is greatly appreciated.
Thanks,
klotzy_550