One-Chip ADSR using the ATTINY1616

Readers: If you'd like to build the ADSR experimenter's board featured in this post, please go to PCBWAY's Community pages--gerber file; KiCAD 10 project/pcb/schematic/library files, Arduino .INO file, modified .h and .cpp helper files, B.O.M., and more, are here.  

You can also help out this blog immensely by checking out PCBWAY using the link here. Thanks!

==============

This one started when DIY rockstar--this guy's kung fu is the best--TJimmyChonga--emailed me about an earlevel C++ library that abstracts analog synthesizer ADSR functionality into a compact C++ library--articles documenting the library begin here; zip of the CPP and H files are here.

Experimenter's PCB for the earlevel ADSR library, and probably a lot more AudioDiWHY fun. 


Looking over the code, I guessed it might be easy to use an ATTINY1616 --that's a <$1USB MCU, folks--to create an entire ADSR since the ATTINY1616 has ample ADC's and a single reliable 8-bit DAC built-in.  

Designed it, gerbered it, got it fabbed, built it. Fast, fast, fast...Good news--yep, it worked.

THE DESIGN

Instead of breadboarding, which drives me nuts, I drew up a 99 x 99 mm PCB "experimenters board" using Kicad10.  

I added 3.5mm input and output jacks; a shottky diode clamp for the trigger input (so a 10V or 12V gate signal didn't blow up the input pin on the MCU) and a few pots....I buffered the output using a DIP TL071....simple stuff; for a lot of this design, anything will do. 


....for future expansion, remaining GPIO was brought out to JST connectors....

As usual, a 3-pin JST in series with a 470 ohm resistor was used for the UPDI programming input.

I included a 7805 regulator, although I could have gotten that from the Euro power cable, but, hey, why bother.

I chose mostly thru-hole for the build since I have tons of THT in my junk box.

Happiness is bubblewrapped brand new PCB's from this blog's patient sponsor, PCBWAY, where ten 2-sided PCB's less than 100x100mm can still be purchased for $5USD. Are you kidding me?

THIS BLOG'S SPONSOR

The gerber got sent off to this blog's trusty sponsor, PCBWAY and back it came with alacrity.  The shameless plug:


--why bother breadboarding when you can throw your ideas into Kicad, ship them off to PCBWAY and get lotsa boards back to mess around with. If they don't work, don't swear, don't stomp around, don't cry....e-waste them in an environmentally friendly way and try again. What's your time worth? 

Prototyping with PCB's is faster and a heck of a lot more fun then breadboarding....wait, there's more! Kicad experts: check out PCBWAY's 2026 Kicad Design Contest--really nice schwag and cash prizes may be yours.

Back to it....

PROOF OF CONCEPT

Since nobody codes any more I used Claude Code to put together the Arduino sketch for a 3 pot ADSR Proof of Concept--Attack, Sustain and Decay/Release--some bugs at first but easily fixed. 



The output worked surprisingly well--nice analog-sounding log response....I thought 8 bits wasn't going to get it done and the output would be "stair stepped" but: it was fine.

For the PCB, there were a couple of stupid mistakes but overall this one was easy--maybe too easy.  

Testing the POC board with the AudioDiWHY dual MS20 filter (post here). Overall the Proof of Concept single chip ADSR, using the C++ Earlevel library, worked a lot better than expected.

OUTRO

In general, the heavy lifting was all done with the ATTINY1616--if I hard coded the ADSR values, jammed 5V from my bench into the MCU, and didn't care about input or output levels, this was literally a one-chip/$1USD design....if there's a lower parts count ADSR out there, I haven't seen it.

OK, whatever....the question, what to do next.  

The fact that the entire EG lives on a single inexpensive MCU means I can sprinkle the damn things all over--add it to a filter, add it to a VCA, add it to a mixer.  

But I also see adding various logic outputs to this--end of attack, end of release--and using them to trigger other events.  

Also it should be easy to modify the DAC to produce linear outputs, log outputs, or whatever you want in-between.

Or, I could go full Behringer and rip off + remarket someone else's design--how about The Intelligel Quadra (4 AR's with clever I/O) with expander, allowing VC of attack and decay, this module sold for something like $300 before being discontinued? I figure I could recreate it using a 4x ATTINY's for something like $30USD?  And add sustain to each of the 4 AR's?   

Make it itty bitty/Eurorack so only folks with tiny little fingers can use it.  

Finally, I'd need to say it was made by "Bellinger" and call it something like "Quad Fumer"--indeed--too easy.

  


No comments:

Post a Comment