June 15, 2014
June 15, 2014
June 18, 2014
Electrical and Computer
24.1216.1 - 24.1216.11
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 morehumanreadable interface to control and status registers (openUART1(BAUD_RATE_9600 |PARITY_NONE…), for example), but this is of little assistance with higherlevel abstractions (write abyte over the I2C bus, for example, which requires a series of blocking reads and writes). Many RTOSproducts do provide helpful highlevel abstractions, but often at the price of significant complexity bettercovered in a later course in embedded systems. Opensource libraries such as Arduino and mbedprovide an easytouse interface for all peripherals, but often obscure the underlying implementationconcepts students must master. There is a need for a lowcomplexity library that provides someabstraction while exposing lowlevel details.Therefore, this paper therefore presents the design philosophy behind an opensource library thatprovides a minimalist hardware abstraction layer for the 16bit family of Microchip’s microcontrollers,created to enable educators to focus on the core concepts common to a microcontroller (such asgeneralpurpose I/O, timers, and serial protocols such as I2C and SPI) while also exposing somelowlevel 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 handsonexperience 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. https://peer.asee.org/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