Meta: Beginner Series

I think I’ll write up a few quickie, digestible posts, on beginner level microcontrollers. With enough of this series, I’ll request a pinned/sticky topic to connect all these posts together so beginners have a place to ask questions or feel welcome.

Subject posts I’m planning on writing about:

  • What is a Microcontroller?
  • Overview of specific microcontroller boards and chips
  • Transistors and amplifiers: controlling large amounts of electricity with tiny chips.
  • Typical sensors, motors, actuators
  • Analog design – the original computers
  • And more… please suggest a topic. I’m not an expert but hopefully I can get some beginner level concepts written up for yall!

What is a microcontroller?

A microcontroller (uC for short) is a “simple” computer especially designed for ease-of-electrical engineering. Most microcontrollers are usable with just a single chip plus power, though a few microcontrollers need a supporting inductor, maybe supporting flash or an external crystal.

Traditionally, microcontrollers made programming more difficult for the tradeoff of easier electrical engineering. With a weaker CPU, cod executed much slower. RAM is far more limited, and the programmers often have no access to a full OS like Linux or Windows to provide common services. But as uCs grew cheaper and faster, we’re starting to see MicroPython, Arduino, and FreeRTOS simplify programming and make them easier than ever before.

This should be compared / contrasted with “microprocessors” that power Smartphones, Raspberry Pi 4, desktops, laptops, and servers. “Microprocessors” have a complex boot routine, requiring firmware on-top-of-firmware, device drivers, and huge lists of initialization to even start up. Microprocessors will always be far larger, faster, and more compute-efficient than a microcontroller, but they ultimately do a different job.

Important Features

  • Popularity – We’re all loathe to admit it, but popularity provides more beginners to talk with… larger communities, and more “buzz” / ideas around a platform. Major platforms like Arduino or Raspberry Pi Pico have huge advantages when searching the internet for information.

  • “Simplicity” – With $5 custom PCBs being shipped from Digikey (and cheaper PCBs from China), it has become cheaper than ever before to make your own custom boards. If you ever plan to design your own board, you should look for the “simplest” designs. RP2040 / Raspberry Pi Pico requires external Flash + a bootstrap sequence… is that cool with you or an unnecessary line on your BoM / Bill of materials? Many microcontrollers only require power and will immediately boot up + run, the ultimate in simplicity. In all cases, microcontrollers will be easier than a full blown microprocessor.

  • I/O – Most microcontrollers provide a litany of alphabet soup protocol support. I2C and SPI are perhaps the most important, but are universally supported. “UART / USART” are an old serial-port pseudo-protocol that also has widespread support, but there’s a lot of devil in the details. USB, 802.11 Wifi, Bluetooth, Zigbee, 2.4GHz, Matter, IrDA, CANbus and… well… I/O support has way too many protocols to even list in this beginner guide. While its important to know your connections, I think its safe to assume I2C, SPI, and Serial Port support universally.

  • Strength of GPIO – All microcontrollers have pins providing on/off support in both read direction and write direction. However, the currents and voltages supported differ grossly between chips. For example, ATMega328p (aka: the Arduino Chip) supports 5V and 20mA / 150mA across the whole chip. Sufficient to fully turn on a 2N7000 transistor, or support a 7-segment LED display. Meanwhile, the RP2040 (Raspberry Pi Pico) only has 3.3V and 50mA limitation across the whole chip, so a 7-segment LED display will be beyond the specs, while the 2N7000 transistor won’t be fully turned on.

How to pick a microcontroller?

Just pick a uC that people around you know about. If you know someone who can help you out, that’s the most important.

If you don’t know anybody in person, my recommendation is for a 5V level uC such as Arduino Uno or the more recent Arduino R4. 5V uses more power, but historically is where old “CMOS” or “TTL” circuits existed. If you find 40-year-old-books from the 80s, their designs innately assume 5V. All of these ancient circuits continue to work today, and you’ll often have an easy time converting the 5V down to 3.3V if you see a modern design. In particular the use of cheap-and-simple 2N7000 transistors at the 5V level can easily move and control other electric signals. But the 2N7000 doesn’t turn on reliably at 3.3V.

Furthermore, older chips tend to be available in PDIP / through hole form factor, allowing the beginner to play on a breadboard. The ATMega328p as old as it is, still has PDIP form factor and can just plug straight into a breadboard today. The pathway to using a full custom board is more straightforward.

Modern uCs tend to be 3.3V or 1.8V and use more modern, efficient parts. But these parts are all surface-mount, requiring either a converter board or a custom PCB to use. These additional steps are more difficult for the beginner to play with actual hardware (Transistors, Motors, etc. etc.).

That being said: a 3.3V board like the Raspberri Pi Pico can perfectly use 2n2222 BJT transistors and amplify the currents to usable levels. And the “entire board” can be used as a component on a breadboard. But you’ll need to learn how to level-shift if you use older 5V chips or see older 5V designs. It requires an additional resistor to work.

If 2n2222 and 2n7000 are alien to you, don’t worry. I’ll cover those transistors later in this beginner series. Just know its a very common circuit component and the 2n7000 is a tiny bit easier to use.

  • minnixM
    link
    fedilink
    English
    1
    edit-2
    1 year ago

    This is great info, thanks for the write up. I’ve pinned this post.