by scrps on 6/6/24, 3:03 AM with 117 comments
by JoeCortopassi on 6/6/24, 3:32 PM
$12, fantastic documentation and tutorials, and you can literally just plug it in via usb and edit the python code as if it's just a text file on a thumb drive. No programmers, special IDE's, or specialty equipment
Microcontrollers are fun again
by guitarbill on 6/6/24, 6:10 AM
In a way, it's ironic. The AVR tooling back in the day was just so much better than PIC (for a novice hobbyist, pre-Arduino).
by watermelon0 on 6/6/24, 5:14 AM
For hobbyists, AVR (ATmega, ATtiny) microcontrollers were really great. Easy to use in C for most cases, great cross-platform toolchain, and many of them came as DIP package, which made them breadboard/protoboard friendly.
Heck, we even had a USB 1.1 library, that could bitbang USB 1.1 on practically any AVR, including 8-pin ATtiny: https://www.obdev.at/products/vusb/index.html
Not to mention, that Arduino started with ATmega, and still have many board featuring it.
I definitely might check Dx line, just to see if the experience is the same as it was before.
by dotdi on 6/6/24, 1:36 PM
When AVR came out with their ATmegas, it was a revelation. Not having to use shitty proprietary programmers and windows-only software was amazing. We could finally use Linux. PIC was one of the main competitors in our circles, but it was losing the foothold quickly, because the AVR tooling was just hands-down better.
Also, documentation was easier to read and interpret, especially compared to PIC, which is still giving me slight PTSD when I try to recall how hard it was to get non-mainstream features to work. Whenever I had to deep-dive PIC documentation I stumbled over weird behaviour or outright hardware bugs that, in some cases, could not even be worked around.
I don't actively work with microcontrollers nowadays, but I am excited to hear that AVR is still making an effort to have an objectively good product. The market is tough nowadays, with ESP32s and ESP8266s being so cheap and widespread, but I hope AVR keeps it up.
by _benj on 6/6/24, 11:07 AM
I didn’t used ATmega a lot, but comparing the experience to MSP430 and EFM8 the AVR chip has a bunch of niceties, superb documentation and life improvements like, in order to clear some registers all one need to do is write 1 instead of the whole =& ~(REG | 0x8) (or something like that, it’s been a while since I write embedded C)
The other thing that I loved is that one can download headers for the chip directly from the manufacturer!
Way too many chip manufacturers keep locking headers/libraries behind their proprietary IDEs, but Microchip, even though they have an IDE let’s you download the headers so one can use whatever tooling one is comfortable with! Props to Microchip for that!!
by buserror on 6/6/24, 9:08 AM
by newswasboring on 6/6/24, 11:58 AM
by genter on 6/6/24, 3:49 AM
by dragontamer on 6/6/24, 2:49 PM
AVR DB has 3x OpAmps for free.
AVR EA and EB have differential 12-bit ADCs with programmable 1x to 16x gain. We're not just talking about measuring 4mA to 20mA protocol easily, but you can measure uA of current with reasonable accuracy with just a shunt-resistor + the AVR EA's ADC.
AVR DD has a dual power-supply with 1.8V to 5V support. That means that some pins can be on 3.3V logic while other pins are on 5V logic. IE: The AVR DD's job is to be a built-in full-and-proper level shifter.
Bonus points: All modern AVR chips (Dx and Ex) have an event-system to route events from any peripheral (Timers, Pins, UART, etc. etc.) to many other pins and even interrupts to the CPU. This combines with the CCL programmable logic unit (Four 3-LUTs + two 1-bit memory cells) to have an incredible amount of "glue logic" built into these chips.
Anyone who comes in this topic and talks about "But 32bit whatevers", ESP32 or about super-cheap RISC-V chips is missing the point of the AVR line. You're not really the ones in the market for this chip. Anyone who has to deal with a cheap design that manipulates a bit of analog sensors, or glue together logic... well... AVR is the right chip for these jobs.
----------
There's one problem. It means that you need to know the ins-and-outs of the peripherals that are offered on these chips. AVR DD cannot do the same current-measuring job that an AVR EA or AVR EB can do.
Mixed-signal Peripherals are so much harder to understand than MHz and SRAM. But for those who are "in the know", well... these are awesome peripherals. Its difficult to find competitors to these chips.
Indeed, a proper bidirectional 3.3V to 5V level shifter across 28 I/O pins alone would probably cost you more than the $1-ish AVR DD.
3x Rail-to-Rail OpAmps with programmable voltage-reference, a DAC and differential ADC is a *bargain* for the AVR DB's $2 price point.
---------
And the whole line offers like 5V and 50mA in/out on the GPIO. Its an extremely forgiving chip. The fun trick is to run Resistor+LED directly off of GPIO because... you can. (Typical LEDs are 20mA).
by andrewstuart on 6/6/24, 3:54 AM
Many of them are available as dev boards for under $20.
You can burn plenty of hours and dollars browsing all the good stuff on electrodragon at https://www.electrodragon.com/product-category/dev-board/
by beryilma on 6/7/24, 3:24 AM
I am actually fascinated with the things you can do with stm32 chips. If I ever do a commercial project, I would definitely use stm32 chips. Bare metal programming them has been a lot of fun.
by blutack on 6/6/24, 7:29 AM
Mitxela has a great article on them [2] and I totally agree they have a lot of the same joy & simplicity of the ATTiny - but with the added bonus of lots of interesting DMA controller misuse!
The peripherals have a very STM feel (in a good way) which perhaps isn't surprising given WCH's history.
0: https://www.wch-ic.com/products/CH32V003.html
by snvzz on 6/6/24, 7:45 AM
by ThrowawayTestr on 6/6/24, 6:17 AM
by SomeoneFromCA on 6/6/24, 10:28 AM
by contingencies on 6/6/24, 9:01 AM
by lloydatkinson on 6/6/24, 12:19 PM
by megous on 6/6/24, 2:46 PM
by throwaway81523 on 6/6/24, 3:50 AM
by hi-v-rocknroll on 6/7/24, 7:32 AM
0. simplicity
1. robustness
2. developer support
3. essential features