Asee peer logo

The Forest and the Trees: Using an Appropriate Level of Library Abstraction for Microcontroller Instruction

Download Paper |


2014 ASEE Annual Conference & Exposition


Indianapolis, Indiana

Publication Date

June 15, 2014

Start Date

June 15, 2014

End Date

June 18, 2014



Conference Session

Innovations in Computer Engineering Courses

Tagged Division

Electrical and Computer

Page Count


Page Numbers

24.1216.1 - 24.1216.11



Permanent URL

Download Count


Request a correction

Paper Authors


Bryan A. Jones Mississippi State University

visit author page

Bryan A. Jones received the B.S.E.E. and M.S degrees in electrical engineering from Rice University in 1995 and 2002, and a Ph.D. in electrical engineering from Clemson University in 2005. From 1996 to 2000, he worked as a hardware design engineer for Compaq, specializing in board layout for high-availability RAID controllers. He is currently an assistant professor at Mississippi State University. His research interests include engineering education, robotics, real-time control system implementation, rapid prototyping for real-time systems, and modeling and analysis of mechatronic systems.

visit author page


Robert B. Reese Mississippi State University

visit author page

Dr. Robert B. Reese is an associate professor in the Electrical and Computer Engineering Department at Mississippi State University.

visit author page


M. Jean Mohammadi-Aragh Mississippi State University Orcid 16x16

visit author page

Dr. M. Jean Mohammadi-Aragh is a visiting assistant professor with a joint appointment in the Department of Electrical and Computer Engineering and the Bagley College of Engineering Dean’s Office at Mississippi State University. Through her role in the Hearin Engineering First-Year Experiences Program, she is assessing the college’s current first-year engineering efforts, conducting rigorous engineering education research to improve first-year experiences, and promoting the adoption of evidence-based instructional practices. In addition to research in first year engineering, Dr. Mohammadi-Aragh investigates technology-supported classroom learning and using scientific visualization to improve understanding of complex phenomena. She earned her Ph.D. (2013) in Engineering Education from Virginia Tech, and both her M.S. (2004) and B.S. (2002) in Computer Engineering from Mississippi State. In 2013, Dr. Mohammadi-Aragh was honored as a promising new engineering education researcher when she was selected as an ASEE Educational Research and Methods Division Apprentice Faculty.

visit author page

Download Paper |


The Forest and the Trees: Using an Appropriate Level of Library Abstraction for Microcontroller InstructionThe relentless advances seen in the microcontroller market now challenge educators with, as Pogo says,an insurmountable opportunity. For less than $5, modern microcontrollers provide a staggering varietyof peripherals coupled with unprecedented processing power. This complexity leads to data sheets thateasily exceed 1000 pages. Instructors face the problem of providing students ready access tomicrocontroller features without overwhelming them with the detailed knowledge that professionalengineers often spend years acquiring.In terms of  microcontroller hardware abstraction, vendor libraries typically provide a morehuman­readable interface to control and status registers (openUART1(BAUD_RATE_9600 |PARITY_NONE…), for example), but this is of little assistance with higher­level abstractions (write abyte over the I2C bus, for example, which requires a series of blocking reads and writes). Many RTOSproducts do provide helpful high­level abstractions, but often at the price of significant complexity bettercovered in a later course in embedded systems. Open­source libraries such as Arduino and mbedprovide an easy­to­use interface for all peripherals, but often obscure the underlying implementationconcepts students must master. There is a need for a low­complexity library that provides someabstraction while exposing low­level details.Therefore, this paper therefore presents the design philosophy behind an open­source library thatprovides a minimalist hardware abstraction layer for the 16­bit family of Microchip’s microcontrollers,created to enable educators to focus on the core concepts common to a microcontroller (such asgeneral­purpose I/O, timers, and serial protocols such as I2C and SPI) while also exposing somelow­level details for students to gain a deeper understanding of the operation of a microcontroller. Inaddition to its pedagogical role, this library also serves a practical role in providing students hands­onexperience using microcontroller peripherals in the course of their laboratory exercises and also scalesto enable students to employ multiple microcontroller peripherals in the course of their capstone designexperience. This library has been used since late 2008, and Google Analytics numbers for the library’swebsite give 84,000 visits since January 2009, with approximately 52% from the United States and therest international.Students are capable of creating amazing designs with the proper instructional support from educators.A library designed for pedagogical use provides instructors with the ability to explain fundamentalconcepts behind microcontroller operation while challenging their students with laboratory exerciseswhich explore the many communication protocols and capabilities of a modern microcontroller.

Jones, B. A., & Reese, R. B., & Mohammadi-Aragh, M. J. (2014, June), The Forest and the Trees: Using an Appropriate Level of Library Abstraction for Microcontroller Instruction Paper presented at 2014 ASEE Annual Conference & Exposition, Indianapolis, Indiana. 10.18260/1-2--23149

ASEE holds the copyright on this document. It may be read by the public free of charge. Authors may archive their work on personal websites or in institutional repositories with the following citation: © 2014 American Society for Engineering Education. Other scholars may excerpt or quote from these materials with the same citation. When excerpting or quoting from Conference Proceedings, authors should, in addition to noting the ASEE copyright, list all the original authors and their institutions and name the host city of the conference. - Last updated April 1, 2015