Hi,I've read that piezzo buzzers (magnetic ones too) can generate a "back emf" when they are heavily shocked (Arduino box falling on the ground for instance) which induces enough voltage and current to destroy the microcontroller output. One should add a diode in parallel to the buzzer to prevent this.What do you think about this aspect?Thanks in advance ^_^
First off, thank you for writing this.I have a few questions, if you don't mind.What is the maximum reliable frequency this can output? I'm hoping that you'll say it can go up to 150kHz for RFID and some other projects I've got in mind.Will it work on a Nano V3.0? I'm guessing that it can because both it and the Uno use the 328p.
Thanks!Pardon my ignorance, but... what is the resolution? Specifically at the >100kHz range?
My apologies, I was not clear.I meant the frequency resolution. A quick look at the files I downloaded would indicate that the resolution at lower frequencies the frequency resolution is better than at some point where the prescaler must change, and there are larger steps in the frequency.Kind of like how millis() is milliseconds and has an actual resolution of 1ms, but micros(), although it is microseconds and can be given any number, has an actual resolution of 4us.Actually I'm looking to use this for an RFID card reader in the 125kHz to 134kHz range. I thought I might try some frequency hunting to look for the tag's actual resonant frequency.
Great library! I'm driving a piezo from a 3v cell, so this really helps!On an Attiny44a, the OC1A/B pins are shared with MOSI/MISO, which works (and piezo chirps when uploading ) with the changes I made to the original code.I need to use the OC0A/B & TCNT0 instead, which is only 8bit, but I need to drive @ ~4000hz, is it possible? Can I chain or loop the timer or interrupt to get ~4000hz? Is there an example of this somewhere?thx!
... Why use a ATtiny anyway? The price is about the same, the ATmega has lower power modes, and the ATmega is available in a smaller footprint. I really find no reason for the ATtiny.
Thx for reply, not really married to the attiny, but I do need something that can run @ ~2v, and I can get the t44a for 80 cents (@10). I did see some atmega8's around the same price, but I think the vcc was higher. Will take another look.