> You'll need to do a little engineering around this I think. The AVR can
> drive 20ma as I to remember, if at your micro Vdd voltage the current
> draw of your piezo is more than that you'll need a driver. Something as
> simple as a logic level FET will do the job nicely. Piezos don't pull a
> lot of current, but yours appears to pull more than your ATTINY13 can
> supply. I've driven piezos directly before, so either there is
> something interesting in your design or your piezo is much more power
> hungry than those I've experienced in the past.
>
The piezo is a capacitor, so any piezo will attempt to draw more
current than the pin can provide, during the switching.
However, the limiting factor here is the Rdson of the output fets, so
that in itself, is harmless.
If the piezo is driven by one pin, and the other side of the peizo is
grounded or tied to VCC, then I don't see how you can get into
trouble.
Re-check how you're setting the pin state in DDR, and avoid any
read-modify-write operations, since the capacitance of the piezo can
interfere with that.
A more interesting effect is what happens at the moment of switching,
if the piezo is driven by two I/O pins.
At the end of a cycle, the piezo is a charged capacitor.
If the switching sequence takes the high side to ground, and then
takes the low side high, all is well.
If the switching sequence takes the low side high first, then you've
just applied VCC*2 with very little current limiting, to an I/O pin.
This is how a max232 generates +12V and -12V for serial.
That's not a happy thing for an AVR I/O pin though.
--
There is no computer problem which cannot be solved by proper
application of a sufficiently large hammer.