8 Comments

As for the differences between models:

AVR DA is the all-around baseline. It's available in packages between 28 and 64 pins and goes up to 128 kB of flash. It has a good mix of digital and analog peripherals.

AVR DB is essentially identical, except for small changes to accommodate some additional signal processing use cases. The chips are interchangeable in most uses and cost about the same. On the DB series, you lose one I/O pin (PD0), gain an op-amp, and have a separate voltage domain for one port. You also have support for a high-frequency crystal, whereas DA only supports a 32.768 kHz timekeeping one.

AVR DD is a stripped-down version of DB, available in smaller packages (14-32 pins) and with less program memory (64 kB). It's a reasonable choice when you want something small and cheap - the series starts around 90 cents, and can do a lot more than ATtiny.

AVR DU is a flavor of AVR DD that has an on-die USB 2.0 subsystem that requires no external components; this includes no need for an external crystal. It's great for HID accessories and such - and likewise, it's pretty darn cheap.

Expand full comment

Do you know of a good FOSS starting point for AVR DU? I've used LUFA quite a bit with the ATmega32u4, but it seems to have reached "maturity" many years ago and I would be surprised if Dean put serious work into extending it.

Expand full comment

Microchip has an example fake HID keyboard implementation here: https://github.com/microchip-pic-avr-examples/avr64du32-cnano-usb-hid-keyboard-mplab-mcc/blob/main/avr64du32-cnano-usb-hid-keyboard-mplab-mcc.X/main.c

The "library" they use is essentially the stuff in here: https://github.com/microchip-pic-avr-examples/avr64du32-cnano-usb-hid-keyboard-mplab-mcc/tree/main/avr64du32-cnano-usb-hid-keyboard-mplab-mcc.X/mcc_generated_files/usb

...which provides some minimal abstraction for the hardware. It's not as nice as LUFA because it's not documented well - but with the spec in hand, it should be fairly easy to wrap your head around it and repurpose it.

Unfortunately, the DU chip is so recent that there probably isn't a whole lot of third-party code beyond this :-( I think they started shipping three months ago? The other series (DA, DB, DD) have been around for longer.

Expand full comment

Very helpful, thank you!

Expand full comment

megaAVR/tinyAVR 0-series are similar too.

Expand full comment

Where does the xmega line fit in?

Expand full comment

They all have the same basic CPU architecture. Xmegas were the proving grounds for the peripheral architecture that shipped in AVR Dx.

I think that Xmega was supposed to be a "premium" package - they cost more, had more flash, faster clocks, crypto accelerators, LCD controllers, etc. But they came out around the same time that Cortex-M was taking off, so this left a very narrow niche for these chips. The ill-fated AVR32 happened around the same time too.

Anyway... AVR Dx is more focused on sensing and automation than on compute, and it's inexpensive enough to be a worthwhile alternative to Cortex-M when you don't want to complicate your life.

Expand full comment

Thanks for the tip

Expand full comment