SparkleTilt: Design a Digital Level PCB
jams.hackclub.comATmega328p is legendary but the AVR64DB32 is a far superior upgrade in almost every way that matters.
64Kb Flash, 16kB SRam, full 24Mhz speed at 1.8V minimum power, 12bit 130ksample ADC, 2x Rail to Rail OpAmps for free (3x on higher end versions), etc etc. Better timers, USART, DAC, Comparator, Zero crossing detector, 50mA per pin with full 1.8V to 5.5V range, 300mA total GPIO source/sink, multiple VRefs, 4x 3-LUTs + 2x JK Flipflops for glue logic, event routing system (peripheral-to-peripheral routing while under deep sleep).
And... AVR64DB32 is cheaper at Digikey than ATMega328pb.
So faster, cheaper, more capable, lower power (sleepwalking peripherals), more flash, better analog components, what's not to like?
I realize that Arduino Uno has made ATMega328p absurdly popular. But AVRs have had over 10 years of upgrades since then. And so has the competition (TIs MSPM0 Cortex M0+ for like 50 cents is very competitive, as is STM32C0 line or STM32U5 low power line)
-------
If you have a legacy design using legacy ATMega328pb parts, well... the hardware drivers have changed in AVR DB line.
But it's all AVR Assembly/machine code. Your libraries and code will otherwise work with just a recompile. I get that peripherals are harder to port but ... Legacy Peripheral driver is pretty much the only reason to stick with the 12+ year old ATMega328pb.
The embedded world moves slower than consumer chips, but it still moves! After a decade, the newer embedded chips are like night-and-day superior over decade+ old models.
> And... AVR64DB32 is cheaper at Digikey than ATMega328pb.
Sure, you save about $0.80 off your BOM, but currently DigiKey has a stock of over 200k ATMEGA328P (in 31 P/N), whereas searching for any of the AVR64DB32 family (of which there are 8 P/N), returns 0 available stock. That savings and feature bump is nice, but if you can't get any, whats the point of designing in this part?
Oh no, you have to buy the AVR128DB32 instead. /s. I think Microchip's at fault for breaking the convention. I fully admit that "AVR_flash_family" is kind of a nonsense convention. Only those who have studied Microchip's modern lineup would know that AVR128DB32 and AVR64DB32 are the same chip.
https://www.digikey.com/en/products/detail/microchip-technol...
The AVR DB series is going strong. I'm kinda surprised the 64kB model has sold out, but 128kB Flash is fine.
-------
I should note that AVR DA, DB, and DD are all _almost_ the same chip, and I personally search on all three and often just pick the cheapest.
AVR DA's standout is integrated capacitive touch sensors.
AVR DB's standout is 2x or 3x OpAmps.
AVR DD's standout is integrated level-shifters on PortC (or perhaps more accurately: a 2nd power rail entirely that those I/O ports operate on instead), and also seems to be the cheapest.
If you aren't looking for any of these specific features, then you can swap between the chips with almost no changes.
Here's my search query for AVR DA, DB, or DD chips: https://www.digikey.com/en/products/filter/embedded/microcon...
Looks like AVR128DA32T-I/PT is the most common at 20,000+ available. There's also cheaper 16-pin models and more expensive 48-pin or even 64-pin models all available today. So its quite a bit more scalable than the old 32-pin only ATMega328p line.
------
AVR EA just came out, but I don't understand them yet.
> AVR EA just came out, but I don't understand them yet.
Okay, I spent a bit of time going over "AVR EA"'s datasheet. Here's my conclusion:
AVR EA's ADC converter is absurdly better. 12-bits and 375kSample/sec with upto 16x programmable gain amplifier (x1, x2, x4, x8, and x16 settings).
So with 12-bit / 375kSps / x16 PGA and a 1.024V internal voltage reference, the AVR EA can accurately measure 15.6 uV (microvolts) resolution. On paper at least. And mind you, this is a _differential_ ADC (all DA, DB, DD, and EA are all differential ADCs). Also, 500uVrms noise at x16 so oversampling required to make any of these lower-end bits usable.
Since this is a tutorial for newbies, I'm intentionally using a chip with years of code, flashing, and peripheral circuit examples. It's also compatible with the Arduino Nano pinout so students can add peripherals with outside circuit examples.
For personal projects, I also prefer using fancier chips like the ESP32 series or the new generation of ATtinys.
I think my top level post here reads overly critical.
I'll say that I think what you're covering is very good material, in that some of the most difficult "first steps" is convincing the student to finally push the "buy" button and actually get a PCB shipped to them.
In the great scheme of things, beginners don't need the newest chips, so you're right. But... I dunno. If they're bothering to build their own PCBs, then at that point they're likely ready to appreciate these benefits from the more recent chips.
One of the biggest problems with recent ATtinys and older ATMega328pb chips is the variable clock rate. If you run at 1.8V, you can only run at 4MHz and the code will be unstable at 20MHz. Keeping track of this changing voltage is... annoying. And its wasteful: If you can run at 24MHz at 1.8V (like these more recent AVR128DB32 chips), then you can get both performance and low-power compared to being forced to run at 5V.
Or alternatively, you can run at 5V and get the full benefits (lower noise, more robustness, easier integration with 4.5V level MOSFETs instead of 3.3V or lower voltage MOSFETs)
--------------
But you're right. There are benefits to using a decade old chip for educational purposes. But I still feel like encouraging pcb-designers (even at the beginner level) to use the most recent set of chips is half the fun. Newer chips really have some very nice features that make life a lot easier.