- Joined
- Apr 24, 2020
- Messages
- 2,566 (1.74/day)
I didn't see any post in the first couple of pages talking about Circuit Theory / Electronics. So I'm making this post! To get us started, this blogpost from 2017: https://jaycarlson.net/microcontrollers/
Also, to help seed this discussion on Circuits / Electronics, I'm going to rant a bit randomly. Don't feel like you have to read all of this to get into the topic!
-------
Despite that blog's focus on the $1 price point... hobbyists probably don't care about the $1 price point. Personally speaking, anything up to $5 is fair game for most of my projects, and $20 to $50 boards are also fair game. I think most people prefer using a well put together board (like Rasp. Pi, Arduino Uno, Teensy, RP2040 Pico, ESP32, etc. etc.). But... somehow I always come back to raw chips. Its just different when you're aiming your design around a custom PCB after all. You have way more freedom and make way smaller designs. Toying with electronics is expensive as it is (since we need oscilloscopes, power supplies and more), the additional costs to go PCB / custom really aren't that bad.
Still, I suggest people to start off on boards like Raspberry Pi, Arduino, Teensy, ESP8266, etc. etc. Feel free to talk about your projects. Or maybe parts that interest you.
Newbies can probably still stick with Arduino Uno, just due to the huge legacy / online tutorial factor involved. But when you're feeling ready to "grow up" and build your own circuit, take a look at the AVR64DB32 before you think of an ATMega328 based circuit. There's been so many improvements it behooves you to at least look at it.
* Full 24MHz at all voltage levels -- Arduino Uno / ATMega328 fans from 10 years ago may remember that 20MHz is only supported on 5V. This restrictive qualifier is no more... the newst AVR DA/DB/DD series, all AVRs of this most recent product line support full speed even at its lowest 1.8V power.
* Up to 128kB Flash / 16kB SRAM -- That old ATMega328 on the Arduino Uno only had 32kB Flash + 4kB SRAM. The line goes up to 128kB / 16kB SRAM now.
* Communications: USART, I2C, SPI -- Arduino Uno fans are familiar with these, but there's been some upgrades. The USART supports "S", syncrhonous, operations over the UART of old. Synchronous communications include any explicit clock-based communication, so basically the USART can serve as another SPI controller... or maybe your own custom protocols. All the Asynchronous / clock-free UART features of old are still supported. (Universal Synchronous / Asynchronous Receiver Transmitter)
* Timers upgraded from Timer0/Timer1/Timer2 into TimerA/TimerB/TimerD -- More modes, more flexibility, but a bit more complicated to configure. Each timer has different power-usage, features, and even sizes.
* RTC -- Arguably the Real-time-clock is also a "timer" of sorts, but... its different. With current-usage at 730nA, the RTC is the lowest-power peripheral you can enable. With capabilities to "wake" the chip out of even the deepest sleep cycles, the RTC is key for ultra-long battery life on the lowest power settings (if you're designing around a CR2032 watch-battery, this could be useful)
* ADC + DAC + Comparators + voltage references, 1.8V to 5.5V -- AVR's wide voltage range and slew of analog peripherals give it benefits with analog parts. The DAC is particularly interesting and somewhat rare in uCs.
* 3.6mA @24MHz. 1.1 mA @4MHz. Idle at 2.3uA, Standby at 600nA -- Relatively low power, but not as low as the "ultra-low" parts that are available today in 2022. Still, 600nA of standby-sleep is well under the leakage current of batteries, so its "good enough" for most people's work.
* 3x Rail-to-rail OpAmps -- This is the big one on the AVR DB series: OpAmps are some of my favorite parts. They are "analog" computers, capable of multiplication, addition, division, exponents, logarithms, and more. This is one of those "deep electrical engineering" tools however, they're extremely difficult for beginners to learn about and really require multiple-years of college worth of training to understand. Though... if you're a beginner, maybe start with the LM358 before you play with the complex OpAmp inside of this particular chip.
Unfortunately, due to upgrades like ATMega328's UART turning into the USART... or the ATMega328 Timer0 turning into the upgraded TimerA, some old code won't work any more on the newest chips. That's the reason why the ATMega328pb still is made ("pb" is the most upgraded model to the ATMega328 before code-incompatibility starts to occur). If you really must stick with your legacy code from an Arduino Uno platform, then buy the ATMega328pb.
Microchip makes both the AVR64DB32 and the ATSAML10. So a lot of the peripherals work-and-act in the same way. In fact, the ICE programmer works on both the SAM-series and the AVR-series chips, so I don't even need to buy a 2nd programmer to work with this line of chips.
I know the STM32 uCs are more popular. But I figured I'd plug in Microchip's 32-bit ARM design as well as a mention.
I get that the RP2040 is pretty hype these days. But the RP2040 chip is missing rather important peripherals: such as a 32.678 kHz crystal support (aka: watch-crystal support), DAC, internal Flash RAM, internal oscillators, and more. As such, it requires a fair bit of supporting circuitry to even boot (12MHz XTAL + SPI Flash). While in contrast, every PIC, AVR, modern 8051, STM32, and most ARM parts (like SAM L10) boot with just +Voltage on their lines. The $1 price point is an illusion, you need another $3+ in parts before the darn thing even works.
The RP2040 does have some nice specs on paper, like 264kB SRAM, dual-core, and PIO. But 20mA current is awful for a Cortex M0+ part (10x more power usage than the SAML10 I talked earlier), and it sleeps at 1.3mA, well over 10,000 more sleep power than its competitors. As an M0+ part, its the smallest core of any ARM design (fewer instructions than the M23 like ATSAML10).
Well, the Rasp. Pi foundation is a giant in education. Their resources are great and simplify project design. But as far as actual specs, you've got rather limited niche where this is useful. RP2040 seems like its got a USB sweetspot. External XTAL is needed for USB to work (the communications require a certain level of precision where internal oscillators are unusable). But there's no easy offramp from the Raspberry Pi Pico. The Arduino Uno could teach beginners how to take a chip, jam it into a breadboard, and still get your code working.
Ultimately, I consider the RP2040 more of an MPU, rather than MCU. An MCU/microcontroller is what you reach for when you need to simplify your circuit, do as much as possible with just one part. An MPU / Microprocessor is what you reach when you need more compute power.
With SRAM counts reaching into 4kB+ or 8kB even on the $1 to $2 chips... graphical screens are on the books!
LCD are an older, familiar technology and are the default pick for a lot of graphics. Typical LCD screens are ~1mA to 2mA for the screen, and maybe ~20mA for the LED backlight. However, Sharp's LS013B7DH03 Memory-LCD has ~50uA (!!!) power consumption instead (though no backlight seems to be available).
E-ink is perhaps my favorite tech, but it has severe downsides. The biggest: a ~2 to ~5 second update time, depending on model. So animations are impossible, and the UI updates are significantly laggy. E-ink also requires high-voltages to operate, so they all require inductor+capacitors to be added into your circuit to boost-up the voltage. This also causes an in-rush current you may have to manage. Digikey keeps Pervasive Display's e-ink in stock
Even Color-TFT is cheap these days Midas Displays offers MDT0096A2 with full color.
----------
Hopefully that's enough of a random rant to get us started!
Also, to help seed this discussion on Circuits / Electronics, I'm going to rant a bit randomly. Don't feel like you have to read all of this to get into the topic!
-------
Despite that blog's focus on the $1 price point... hobbyists probably don't care about the $1 price point. Personally speaking, anything up to $5 is fair game for most of my projects, and $20 to $50 boards are also fair game. I think most people prefer using a well put together board (like Rasp. Pi, Arduino Uno, Teensy, RP2040 Pico, ESP32, etc. etc.). But... somehow I always come back to raw chips. Its just different when you're aiming your design around a custom PCB after all. You have way more freedom and make way smaller designs. Toying with electronics is expensive as it is (since we need oscilloscopes, power supplies and more), the additional costs to go PCB / custom really aren't that bad.
Still, I suggest people to start off on boards like Raspberry Pi, Arduino, Teensy, ESP8266, etc. etc. Feel free to talk about your projects. Or maybe parts that interest you.
AVR64DB32-- 8-bit AVR still lives! My microcontroller of choice
Anyone who has become advanced with the Arduino Uno would feel at home with the AVR64DD32, but 10+ years of updates deserves a review.Newbies can probably still stick with Arduino Uno, just due to the huge legacy / online tutorial factor involved. But when you're feeling ready to "grow up" and build your own circuit, take a look at the AVR64DB32 before you think of an ATMega328 based circuit. There's been so many improvements it behooves you to at least look at it.
* Full 24MHz at all voltage levels -- Arduino Uno / ATMega328 fans from 10 years ago may remember that 20MHz is only supported on 5V. This restrictive qualifier is no more... the newst AVR DA/DB/DD series, all AVRs of this most recent product line support full speed even at its lowest 1.8V power.
* Up to 128kB Flash / 16kB SRAM -- That old ATMega328 on the Arduino Uno only had 32kB Flash + 4kB SRAM. The line goes up to 128kB / 16kB SRAM now.
* Communications: USART, I2C, SPI -- Arduino Uno fans are familiar with these, but there's been some upgrades. The USART supports "S", syncrhonous, operations over the UART of old. Synchronous communications include any explicit clock-based communication, so basically the USART can serve as another SPI controller... or maybe your own custom protocols. All the Asynchronous / clock-free UART features of old are still supported. (Universal Synchronous / Asynchronous Receiver Transmitter)
* Timers upgraded from Timer0/Timer1/Timer2 into TimerA/TimerB/TimerD -- More modes, more flexibility, but a bit more complicated to configure. Each timer has different power-usage, features, and even sizes.
* RTC -- Arguably the Real-time-clock is also a "timer" of sorts, but... its different. With current-usage at 730nA, the RTC is the lowest-power peripheral you can enable. With capabilities to "wake" the chip out of even the deepest sleep cycles, the RTC is key for ultra-long battery life on the lowest power settings (if you're designing around a CR2032 watch-battery, this could be useful)
* ADC + DAC + Comparators + voltage references, 1.8V to 5.5V -- AVR's wide voltage range and slew of analog peripherals give it benefits with analog parts. The DAC is particularly interesting and somewhat rare in uCs.
* 3.6mA @24MHz. 1.1 mA @4MHz. Idle at 2.3uA, Standby at 600nA -- Relatively low power, but not as low as the "ultra-low" parts that are available today in 2022. Still, 600nA of standby-sleep is well under the leakage current of batteries, so its "good enough" for most people's work.
* 3x Rail-to-rail OpAmps -- This is the big one on the AVR DB series: OpAmps are some of my favorite parts. They are "analog" computers, capable of multiplication, addition, division, exponents, logarithms, and more. This is one of those "deep electrical engineering" tools however, they're extremely difficult for beginners to learn about and really require multiple-years of college worth of training to understand. Though... if you're a beginner, maybe start with the LM358 before you play with the complex OpAmp inside of this particular chip.
Unfortunately, due to upgrades like ATMega328's UART turning into the USART... or the ATMega328 Timer0 turning into the upgraded TimerA, some old code won't work any more on the newest chips. That's the reason why the ATMega328pb still is made ("pb" is the most upgraded model to the ATMega328 before code-incompatibility starts to occur). If you really must stick with your legacy code from an Arduino Uno platform, then buy the ATMega328pb.
ATSAML10 -- Microchip's "Ultralow Power" ARM Cortex-M23
Today, a lot of people are more interested in the 32-bit ARM parts, such as the ATSAML10. Slightly more expensive than the 8-bit uCs, the ATSAML10 is Microchip's lowest-power 32-bit ARM available. How low power? Its actually lower power than my preferred AVR64DB32... going full-tilt at under 3mA and sleeping in the 100nA range (!!). It even has those fancy Op-Amps I love on it.Microchip makes both the AVR64DB32 and the ATSAML10. So a lot of the peripherals work-and-act in the same way. In fact, the ICE programmer works on both the SAM-series and the AVR-series chips, so I don't even need to buy a 2nd programmer to work with this line of chips.
I know the STM32 uCs are more popular. But I figured I'd plug in Microchip's 32-bit ARM design as well as a mention.
RP2040 -- Fine MPU, terrible MCU
I get that the RP2040 is pretty hype these days. But the RP2040 chip is missing rather important peripherals: such as a 32.678 kHz crystal support (aka: watch-crystal support), DAC, internal Flash RAM, internal oscillators, and more. As such, it requires a fair bit of supporting circuitry to even boot (12MHz XTAL + SPI Flash). While in contrast, every PIC, AVR, modern 8051, STM32, and most ARM parts (like SAM L10) boot with just +Voltage on their lines. The $1 price point is an illusion, you need another $3+ in parts before the darn thing even works.
The RP2040 does have some nice specs on paper, like 264kB SRAM, dual-core, and PIO. But 20mA current is awful for a Cortex M0+ part (10x more power usage than the SAML10 I talked earlier), and it sleeps at 1.3mA, well over 10,000 more sleep power than its competitors. As an M0+ part, its the smallest core of any ARM design (fewer instructions than the M23 like ATSAML10).
Well, the Rasp. Pi foundation is a giant in education. Their resources are great and simplify project design. But as far as actual specs, you've got rather limited niche where this is useful. RP2040 seems like its got a USB sweetspot. External XTAL is needed for USB to work (the communications require a certain level of precision where internal oscillators are unusable). But there's no easy offramp from the Raspberry Pi Pico. The Arduino Uno could teach beginners how to take a chip, jam it into a breadboard, and still get your code working.
Ultimately, I consider the RP2040 more of an MPU, rather than MCU. An MCU/microcontroller is what you reach for when you need to simplify your circuit, do as much as possible with just one part. An MPU / Microprocessor is what you reach when you need more compute power.
Small screens: E-ink, LCD, and TFT...
With SRAM counts reaching into 4kB+ or 8kB even on the $1 to $2 chips... graphical screens are on the books!
LCD are an older, familiar technology and are the default pick for a lot of graphics. Typical LCD screens are ~1mA to 2mA for the screen, and maybe ~20mA for the LED backlight. However, Sharp's LS013B7DH03 Memory-LCD has ~50uA (!!!) power consumption instead (though no backlight seems to be available).
E-ink is perhaps my favorite tech, but it has severe downsides. The biggest: a ~2 to ~5 second update time, depending on model. So animations are impossible, and the UI updates are significantly laggy. E-ink also requires high-voltages to operate, so they all require inductor+capacitors to be added into your circuit to boost-up the voltage. This also causes an in-rush current you may have to manage. Digikey keeps Pervasive Display's e-ink in stock
Even Color-TFT is cheap these days Midas Displays offers MDT0096A2 with full color.
----------
Hopefully that's enough of a random rant to get us started!
Last edited: