Selecting a Microcontroller for Your Classroom

Recently, we have received several requests from educators. They are seeking guidance to help select the perfect microcontroller for their classrooms.

This is not a simple question as there are so many low-cost high-performance options to choose from. There are the classic 8-bit microcontrollers such as the 8051, MSP430, Z8, AVR, and PIC. There are modern dynamos such as ARM and other 32-bit offerings from a number of manufactures. There are also System on Chip (SoC) and Field Programmable Gate Array (FPGA) options. These advanced microcontrollers options provide flexible analog and high-speed plus parallel digital processing capabilities.

Where to Start?

We should acknowledge that there is no single perfect microcontroller. Instead, there are a variety of microcontrollers allowing the designer to optimize for a given design. Since there is no single perfect microcontroller, we should not expect a single classroom solution.

Please allow me to share my experience and opinions regarding microcontrollers in the classroom. Before joining the DigiKey team, I did teach microcontroller classes to a variety of students ranging from absolute beginners to capstone EE classes with independent high-flyers. I have also taught classes featuring a variety of microcontrollers. While I’m far from the most experienced professors, you may find a few gems in this note.

The content of this note is applicable to first and second semester classes microcontrollers. The ideas are suitable for advanced high school students and college students entering a technology or electrical engineering program. We will attempt to balance programming with the need for prototyping by connection of the microcontroller to external circuitry.

Programming Fundamentals

One of the first questions an educator must address is the programming skills of their students. Concepts such as types, branching, loops, and functions must be learned quickly to unlock the potential of the microcontroller.

The hard way

Simultaneously attempt to teach programming, operation of peripherals, interpretation of data sheet descriptions of registers while connecting hardware to the microcontroller.

The easy way

Assuming your academic program doesn’t already have an introductory programming class. I see two options. First you could spend a month of class time outside of the microcontroller with a focus on C programming using online tools such as the GDB online Debugger. An alternative is to leverage the Arduino community. Use simple hardware such as a tri-colored LED and a piezoelectric buzzer to explore the branching, loops, and functions.

Tech Tip: The term Arduino has multiple dimensions. One view is to focus on the company itself located at Arduino - Home. Another view recognizes that Arduino is an open source platform with a large active community base. This is a valuable resource that all students should leverage.

At the same time, we need to recognize the education contradiction associated with Arduino. While it is designed to make programming easier, it is not a simple program. For example, consider the “simple” digitalWrite( ) function. You will find that the Arduino code to seamlessly integrate this function across all Arduino family members is anything but simple.

Breadboard Friendly Devices

Assuming we are teaching electrical technology or electrical engineering classes, students should expect to breadboard circuits. This will help them understand the purpose of a microcontroller and reinforce earlier lessons in electronics.

With regards to breadboards, there are a few viable form factors including:

  • Dual Inline Package (DIP) microcontrollers: The vast majority of microcontroller are produced in surface mount configuration. One exception is Microchip that continues to produce microcontroller in a DIP package.

  • Surface Mount Devices (SMD) to DIP adapters: Adaptor boards are available allowing most low-cost microcontrollers to be used with a breadboard.

  • Breadboard friendly devices: There are a large number of microcontroller evaluation boards that feature the target microcontroller along with a programmer and even an in-circuit debugger. Representative examples include Silicon Lab’s Busy Bee, STMicroelectronics’ Nucleo, Microchip’s Curiosity Nano, and Arduino’s Nano line of products. There are also any number of shields, hats, capes, or other named expansion boards that allow a microcontroller development kit to interface with a breadboard.

Recommend you focus on 3.3 VDC components to follow the trend in lower voltages thereby allowing greater future flexibility.

Preferred Option

Microchip’s PIC an AVR stand out. Most of these products are available in DIP form including 8, 14, 20, 28, and 40 pin alternatives.

Tech Tip: There are many unique SMD packages with a trend toward ever smaller footprints. Among the larger SMD devices, we often find SOIC options. Adapters such as this SOIC-16 are available. These devices fall within the soldering skills of 1st year technology and engineering students. With a small amount of practice on a scrap PCB, they will be able to solder the SOIC using hot air or a small conventional soldering iron.

Debugging Techniques

The ability to quickly debug a program must be developed. This would include compilation and run-time errors. Most IDEs provide good support for compilation errors often with tools that will bring us to the questionable line of code. Run time errors have no such support.

Debugging techniques for intermediate students include the use of:

  • breakpoints and watchpoints: If supported, these tools allow the programmer to “look” into the microcontroller to inspect and even change variables and the registers associated with a microcontroller’s peripherals.

  • I/O pin(s): This could be as simple as an external LED or an oscilloscope to view duty cycle. A more complex example may use a multi-bit logic analyzer.

  • print statements: This simple technique allows the programmer to present the values on a serial monitor or serial graphing display. While it is a powerful technique, it consumes microcontroller resources and may interfere with the timing of high-speed processes.

  • simulation: If available, the tool can provide insight similar to breakpoints and watchpoints.

Students will spend a large amount of time learning and then deploying debugging techniques. As an educator, it’s important to select a microcontroller, IDE, and associated debugging tool that work together to support the student’s learning. All things considered, I would argue breakpoints and watch windows are an essential aspect of this process.

If you have not already done so, this is a good time to consider Jay Carlson’s work in Evaluating the $1 Microcontroller. The document provides an in-depth exploration of a variety of low-cost microcontrollers suitable for the education environment. The side-by-side comparison explores multiple aspects of the microcontroller and supporting infrastructure leading to a holistic understanding the entire microcontroller ecosystem.

Preferred Option

Any platform that supports a low-cost in-circuit debugger. Based on Carlson’s suggestions and my own experience, there is a bias towards 8-bit microcontrollers including the Silicon Labs 8051 and smaller PIC16 family members. The ATtiny is also a contender under the new MPLAB support.

Unlock Peripherals

Graphical peripheral configuration tools are an important part of a programmer’s workflow. Today, nearly every Integrated Development Environment (IDE) features these automated tools. And for good reason. As the size and complexity of microcontroller peripherals has skyrocketed, so too has the size and complexity of the associated datasheet.

As educators, we need to step back and ask if these tools are appropriate. There is a good argument about the need to focus on the latest 200 MHz 32-bit ARM and the industry standard practice of using the configuration tools. However, there is a stronger argument for teaching students the underlying principles; to teach them the foundation and thought process associated with peripheral configuration.

It is important to separate practice from principles.

Avoid conflating the actions of a seasoned microcontroller programmers with the underlying foundation of how they think and how they became the experienced professional in the first place. When, not if, the automated tools perform unexpected actions, students must be able to locate and interpret the datasheet.

With that said, I would recommend that datasheet page length be considered in the selection process. Page length is directly correlated with the complexity of the microcontroller’s peripherals. I’d like to set a 100-page limit, but that eliminates nearly all modern microcontrollers. A page length of 300 is more appropriate. This provides the novice a reasonable but manageable set of peripherals.

A reasonable critique is that students will run out of resources. Fair enough. Students may indeed run out of memory and I/O pins. Yet, this may be a learning opportunity in device optimization. Students can explore lessons in integer math to minimize program size. They can explore PIN multiplexing as when a nibble of LCD driver pins is used as column selectors in a 4 x 4 pushbutton matrix. There is also my personal favorite solution for expanding the I/O. The double buffered SN74HC595N provides an excellent introduction to serial operation. The MCP23017-E/SP is another solid addition to your lab. This particular I^2C device continues the lessons in serial communication while reinforcing the concepts of I/O pin direction.

Preferred Option

Smaller and simple is better. The bias remains favoring the 8051, PIC16, and ATtiny.

Interrupt Service Routines, Stack, Context Saving, and Sleep

The Interrupt Service Routine (ISR) along with related hardware and programming techniques are the most important aspects of microcontroller programming. They define the microcontroller and are key to efficient real-time processing. Get this right and the student is ready to move on to higher-level concepts such as a Real Time Operating System (RTOS) and advanced peripherals such as the Direct Memory Access (DMA). Unfortunately, these abstract concepts are complicated and not readily apparent to the novice. We could argue that complexity squares with the microcontroller’s configuration options.

Let’s consider the RTOS. This is a powerful microcontroller-based programming tool worthy of study. A meaningful discussion of RTOS involves the concept of context switching and timers. A simplistic approach views the RTOS as microcontroller software that switches between tasks at regular intervals. The result is a microcontroller that appears to perform the tasks simultaneously. The RTOS handles the background tasks of context switching and coordination through a choreographed protocol that defines what, when, and how each element is to operate.

Earlier we stated that there is no single perfect microcontroller. Instead, microcontrollers are selected so as to optimize the design of a given product. For most products, we need the RTOS like multitasking features but do not need, or desire, the overhead associated with an RTOS. The solution to this problem is as old as the microcontroller itself and comes in the form of the ISR.

The ISR allows the microcontroller to operate using a foreground-background scheduler. The foreground is the ISR and the background is the contents in main( ). A simple example is a multi-segment Seven Segment Display (SSD) multiplexer such as a 4-segment digital clock display. The program in main( ) may calculate the value to be displayed. A timer based ISR is then used to activate the specific segment. In the background, the microcontroller may sleep for the majority of the time. Meanwhile the ISR will dutifully update each SSD segment to preserve persistence of vision.

Other ISR examples appropriate to a student’s first exploration include:

  • non-blocking timers that provide relatively precise time delays

  • reading a high speed quadrature encoder with position periodically reported to a serial monitor or serial grapher

  • frequency measurement

  • pulse width measurement

  • play a song (one timer for the note and another for the note duration)

  • Proportional or Proportional Derivative Controller (PID) with deterministic timing.

None of these classic ISR based ideas are simple. There are significant challenges associated with transferring multi-byte information between the foreground and background processes to say nothing of the troubleshooting challenges. As students learn solutions such as flag and mailbox, they will be ready for concepts such as semaphores and locks associated with the RTOS.

On a related note, class time is a precious resource. We should make every effort to make the essential lessons stand out from the noise. One of the best ways to do this is to choose a relatively simple microcontroller. A smaller feature set and smaller corresponding datasheet allows student to quickly identify the implementation details. They do not need to wade through dozens of pages exploring the various configuration options associate with the idea. The objective is to make the idea clear and then learn by implementing a working solution.

Preferred Option

Smaller and simple is better. Now, I wouldn’t revert all the way back to a 6-pin PIC10. Instead, something in the simpler PIC16 family, the 8051, or ATtiny may be appropriate.

Tech Tip: Before ending this section, we should take a closer look at the 8051. In my opinion, the 8051 has one of the most elegant solutions for context switching. Recall that the PIC has a single working register (W) and the AVR has 32 8-bit registers closely associated with the ALU. The 8051 also has 32 8-bit registers however, it can only access 8 registers at any given time. The two bank select bits determine which octet is available. This allows the programmer a single-cycle instruction to switch context between various tasks. This smart solution can be advantageous for situations such as the foreground-background processing.


Recent world events changed the way many schools conduct their electronics labs. Online or hybrid classes are the norm. Students are often required to purchase their own component and test equipment. Therefore, we should carefully consider the cost, not only the microcontroller, but the supporting hardware.

Evaluation kits are certainly a way forward, as many of these small PCB’s feature a programmer and some feature an integrated in-circuit debugger. The previously mentioned Nucleo, Curiosity, and Busy Bee are all representative examples. These are easy to use but they are one-and-done products.

As an alternative, the student could instead purchase a full featured external debugger. For the approximate cost of 2 or 3 evaluation boards, they could purchase the debugger and a few spare microcontrollers. Examples include the SiLabs “USB Debug Adapter” or the MPLAB SNAP. Both devices have a similar cost and capabilities. The Microchip may have an advantage in that it can program both PIC and AVR devices.



From an education standpoint, there is something to be said for students physically connecting a microcontroller directly to the debugger. This gives them a better understanding of how the associated programming I/O pins may, or may not, be shared with other devices. This statement extends to powering the microcontroller. Together the lessons learned will allows students the ability to scratch build a PCB featuring the microcontroller, header for the debugger, and appropriate power.

Preferred Option

No change, we are still biased toward the small PIC16 family, the 8051, and the ATtiny.

Tech Tip: Select member of the ATtiny may be programmed using the Arduino as the programmer. While this is desirable form a cost perspective, the system lacks in-circuit debugging capabilities.

Textbook and Forum Resources

This article supports the use of microcontrollers such as the 8051 and smaller members of the PIC and AVR family. These devices are not new. The 8051 and derivative trace back to 1980 and the PIC dates back to 1976. The AVR is a relative newcomer dating back to 1996. Chances are these devices are older than you and certainly older than most of your students. This is good news and bad news depending on how you look at the situation.

First, we need to recognize the enduring longevity of these 8-bit microcontrollers. They have been and will likely be with us for many decades. This is another way of saying that they remain relevant and worth of study. Consider the 8051, I am always impressed when I visit the supported devices page for the Keil processor. List of Chips Supported by Keil. The list of 8051 derivatives grows with a bold New! showcasing each new arrival.

Next, we need to recognize that a wealth of relevant material has been generated over the decades. Much of this is still relevant to today’s 8-bit products. There are a variety of forums such as AVRFreaks which has been active for over two decades. Here is a short list of related forums:

There is some bad news. Part of this stems from the issue of separating practice from principles.

There is risk in stating that the solution for microcontroller education is found in 50-year-old parts with aging architecture and limited features. While I’d like to believe the argument is compelling, it’s not a popular solution. Instead, we find significant attention directed toward platforms such as Arduino and high-performance solutions such the 32-bit ARM, RTOS, and Python. This does make textbook selection a challenge. Yet, a quick search reveals many options are available even if the publication dates are 10 to 20 years old.

Textbook availability is often mitigated by manufacturers. One such resource is Microchip University. We have already mentioned the various technical forums. Videos are available. Many are high quality productions by knowledge professors. And if students are careful and serious about their learning AI can be a useful tool.

Parting Thoughts

As we depart, I encourage you to share your thoughts on this topic. Do you agree that nearly 50-year-old microcontroller architecture is the foundation for advanced topics? Is the hands-on prototyping balance appropriate? Is there a better method? What have we overlooked?

Best Wishes,


1 Like

At the student level given our current state of things I can’t say I’d often recommend the expense of a separate debugger.

A lot of entry level platforms like TI Launchpad or STMicro Nucleo or Microchip’s ATMEGA328P XPLAINED MINI have a debugger built right in for less than the price of a sit down dinner somewhere.

1 Like

Hello @Kristof_2649,

Yes, most manufactures provide a breadboard friendly development board. Devices such as the Curiosity and Nucleo are indeed useful and easy to use.

The price for an external debugger isn’t that high relative to the cost of the development boards. Also, it can be a good investment if a person uses more than 2 to 3 microcontrollers.

Horses for courses.

Although, I recently spoke with a person building their own PCB. Integrating a programming header and multiplexing the I/O pins is a good skill to learn especially when cost optimizing a project. It’s a skill reinforced by using an external debugger.



1 Like