0% found this document useful (0 votes)
58 views4 pages

Improving Microcontroller Education

This document discusses improving microcontroller education by integrating a hands-on lab experience into a single microcontroller course. It analyzes the microcontroller curriculum at various universities and finds that many rely on assembly language programming and do not require hardware interfacing experience. The increased complexity of modern microcontrollers makes assembly-level programming and a two-course approach challenging. The document proposes combining programming and interfacing into a single course taught primarily in C to better equip students for capstone design work.

Uploaded by

m.abdelbar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views4 pages

Improving Microcontroller Education

This document discusses improving microcontroller education by integrating a hands-on lab experience into a single microcontroller course. It analyzes the microcontroller curriculum at various universities and finds that many rely on assembly language programming and do not require hardware interfacing experience. The increased complexity of modern microcontrollers makes assembly-level programming and a two-course approach challenging. The document proposes combining programming and interfacing into a single course taught primarily in C to better equip students for capstone design work.

Uploaded by

m.abdelbar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Improving the Effectiveness of

Microcontroller Education

Robert B. Reese and Bryan A. Jones


Department of Electrical and Computer Engineering
Mississippi State University
Starkville, MS USA
{reese, bjones}@ece.msstate.edu

Abstract—The increased power and functionality of modern language programming, followed by a microcontrol-
microcontrollers provides both an opportunity and a challenge ler/hardware interfacing course, into a single course.
to educators. Increased complexity, the necessity of integrating a
hands-on lab experience, and downward pressure on total curri- II. BACKGROUND
culum hours demand a significant investment of time to mod- These barriers hamper many educators in their efforts to
ernize microcontroller education, which few educators can af- improve the effectiveness of microcontroller education. Table
ford. However, a successful microcontrollers course provides a I shows a sampling of microcontroller content at institutions
unique opportunity to equip students to produce large, complex that competed in the SECON 2008 student hardware competi-
systems in their capstone design course. This paper details the
tion. The schools listed are those had detailed course informa-
evolution of an approach which provides an integrated course
tion accessible from the web; general catalog information was
and laboratory experience for students. Results of these changes
produced quantitative differences in the resulting capstone de-
not used. In general, only the EE requirements were checked,
sign courses, validating the approach. since almost all programs had the microcontroller course re-
quired of computer engineering majors.
I. INTRODUCTION As detailed in the course sampling of Table I, 67% of the
In modern embedded digital systems, a microcontroller is surveyed schools employ assembly language in their curricu-
as fundamental a component as transistors and individual logic lum, hampering student understanding of the nuances of
gates were 30 years ago. It is difficult to envision any type of hardware subsystems. For example, simple statements in C
digital system other than the most simple that does not incor- such as “if (i8_a < i32_b)” mask important architectural fea-
porate a microcontroller (or multiple microcontrollers). tures such as sign extension, varying data with (8 vs. 32 bits),
Shrinking transistor geometries have allowed microcontrollers signed vs. unsigned comparison, conditional branches, and
to incorporate tens of subsystems around the CPU core, mak- register allocation and assignment. Only 56% require micro-
ing modern microcontrollers extremely flexible in their capa- controller interfacing, limiting student ability to design com-
bilities. It was thought in the 90s that Field Programmable plex systems in a capstone design course. As a result, students
Gate Arrays (FPGAs) would eventually eclipse microcontrol- find the intelligence of their designs constrained to a handful
lers as the platform of choice for digital system implementa- of comparators, as shown in Figure 3. In contrast, Figure 1
tion, but this has not happened because of the increasing illustrates the design complexity students achieve based on a
speed, increasing flexibility, lower power consumption, faster firm grasp on the theory and application of microcontrollers;
prototyping, wider application range, and cheaper cost of a
microcontroller solution. However, the increasing complexity
of these devices leads to challenges for the instructor.
Effective teaching of microcontroller programming and
hardware interfacing is challenging within EE and CPE pro-
grams for several reasons. First, a modern microcontroller is a
complex system, with datasheet, programming reference, and
family reference materials totaling over one thousand pages.
Becoming familiar with a microcontroller family at the detail
necessary for course integration is a time-consuming task for
an educator. Second, microcontroller education still requires a
significant hands-on laboratory experience despite advances in
system simulation. Developing this laboratory experience re-
quires an even greater time investment by the educator. Final-
ly, downward pressures on total curriculum hours has forced
educators to think of creative ways to combine traditional two-
course sequences such as computer organization/assembly
Figure 1. Photo of completed project, capstone course, Spring 2008.

978-1-4244-5855-4/10/$26.00 ©2010 IEEE 172


TABLE I. A SAMPLING OF MICROCONTROLLER REQUIREMENTS AT VARIOUS INSTITUTIONS
Institution Course Processor
University of Alabama (Tuscaloosa) ECE 383 Microcomputers Freescale MC9S12DP256B, C
University of Kentucky EE 383 Embedded Sys. Freescale 68HC12, asm
Auburn ELEC 2220 Computer Sys. Freescale 68HC12, asm
Univ. of Tennessee (Knoxville) ECE 355 Computer Sys. Fund. PowerPC family, asm + C,
ECE 455 Embedded Progr. TI MSP 430, C
University of South Carolina (EE Dept) CSCE 212 Intro. to Comp. Arch. asm, no lab
CSCE 313 Embedded Sys. Lab Freescale 68000
University of South Alabama EE 264 Microprocessors and Interfacing Freescale 68HC11, asm
Tennessee Tech. Univ. ECE 3120 Microcomputer Sys\. Freescale HCS12, asm + C
Embry-Riddle Aeronautical University CEC 320 Microprocessor Sys. Freescale 68000, asm
University of Louisville ECE 412 Freescale 68HC11, asm
The Citadel ELEC 330 Digital Sys. Eng. Freescale 68HC11, asm
University of Central Florida EEL 4767C Computer Sys. Design Freescale MC68HC11, asm
Old Dominion University ECE 446 Microcontrollers Freescale MC68HC11, asm
Clemson ECE 371 Microcomputer Interfacing Freescale MC9S12DP256B, C
North Carolina State University ECE 306 Intro. to Embedded Sys. Renesas M16C/16P, C
Florida State Univ. EEL 4746 Microprocessor Based Sys. Design Freescale MC68HC11, asm
Virginia Commonwealth EGRE 364 Microcomputer Sys. Atmel ATMega, asm
Florida International EEL 4746 Microprocessor Based Sys. Design Intel 80386DX, C
University Of Florida EEL 4744C Microprocessor Applications Freescale 68HC12, asm

In addition, 78% of the schools employ Freescale processors From the data in Table I, it would appear that the approach
which provide a very limited selection of DIP-packaged ICs, proposed in this paper could be of value to educators who are
further complicating capstone design efforts. currently using their microcontroller course for teaching as-
sembly language programming, and for those who are also
The strong emphasis on an assembly-only approach, taken using assembly language for the hardware interfacing portion
by 67% (12/18) of the schools, follows the standard approach of the course. This paper outlines a method more fully covered
taken by textbooks written in the 90s and early in this decade in [3] which maintains an exposure to assembly programming
[1, 2]. The reason for this was that on-chip program space and for their students, but uses the C language for the hardware
data RAM was limited, so microcontroller programs had to be interfacing topics. References [4-5] provide additional exam-
highly optimized. Also C compiler choices for microcontrol- ples of microcontroller texts published after 2000 whose prin-
lers were limited. However, modern microcontrollers now cipal programming language is C.
have large amounts of program memory, with even lower-end
8-bit microcontrollers commonly having 16 Kbytes of flash A. Trends in Microcontroller Development and its
memory or more, and data RAM in low multiples of Kbytes. Educational Impact
Only 56% of the sampled institutions (10/18) require mi- Modern microcontrollers feature tens of subsystems clus-
crocontroller interfacing for EE majors; the rest have it as a tered around a CPU core. A list of the subsystems for a
either a Junior or Senior elective. All of the curriculums that PIC24HJ128GP502, which is available in a 28-pin DIP, are:
have it as an elective have a computer organization course as a • 128 KiBytes of non-volatile program memory, 8 Ki-
prerequisite. Therefore, many students find themselves poorly Bytes of SRAM
prepared to execute complex designs for their capstone design
course. • Five 16-bit timers
Freescale (formerly Motorola) processors are used in most • Four PWM and output compare channels
of the embedded courses (14/18, or 78%), due to Motorola’s
domination of the embedded market in the late 80s and 90s. • Two UARTs (asynchronous serial communication)
Many good assembly language textbooks were written for • Two Serial Peripheral Interface (SPI) ports (synchron-
Freescale processors during that time frame, so they were a ous communication)
natural choice for embedded courses. A good university pro-
gram by Freescale and inertia in the academic environment • One Controller Area Network (CAN) port (synchron-
has enabled them to maintain that presence. The predominance ous communication, used in automotive industry)
of assembly language programming for Freescale processors
is historical because C compilers for Freescale were initially • One Inter-Integrated Circuit (I2C) port (synchronous
only offered by third parties, with spotty support for student communication)
editions. This has changed in this decade, with the CodeWar- • One Cyclic Redundancy Check (CRC) generator
rior suite now offered in student editions that have a limit on
maximum program size and number of files. Support of DIP • One 10-bit/12-bit ADC with multiple channels and
packages for prototyping on Freescale's various families re- DMA
mains poor. • One real-time clock module

173
• General purpose IO Black wire is ground
From an educational viewpoint, this single device is easily USB-to-serial conn.
capable of filling an entire semester's worth of hardware inter- RTS#, connect to
facing experiments; in fact, it contains more capability than MCLR# for bootloader
RP10 (RX)
RP11 (TX)
can be covered in a single semester. This classes of devices
can be considered a Super Microcontroller when compared to
L1 LED
the devices of the 90s.
GND
6 V input GND
Coupled with Super Microcontrollers has been the emer- 3.3 V
R1 (910 Ω)
gence of Super Peripherals, which are peripherals with SPI or C3 (10.0 µF)
I2C serial ports that encapsulate complex communication pro-
C5
tocols and physical interfaces for standard communication PIC24HJ32GP202
links such as Zigbee wireless [6], Wireless Ethernet 802.11 Power Sw. MCLR# Sw. C2 (0.1 µF)
[7], or USB [8]. These Super Peripherals actually house an
fuse.
internal microcontroller and its associated software stack to GND
implement the peripheral function, simplifying system design 3.3 V reg. 3.3 V
by keeping the software complexity of these communication C1 (10.0 µF R3 (10 kΩ)
or higher)
links out of the main microcontroller's code space. It also
brings more parallelism to the system because the system con-
Figure 2. Wiring required for the first hardware lab.
tains multiple microcontrollers, with different microcontrollers
dedicated to specific communication systems. The Super Mi-
bag of parts can be a painful but educational experience, but it
crocontroller with multiple UART, SPI, I2C, or CAN ports
only has to be done once. After that experience, we have
combined with Super Peripherals allow a building block ap-
found that students then understand the individual components
proach to system design.
of a microcontroller system, which instills the required confi-
III. INSTRUCTIONAL APPROACH dence for building a custom PCB when they need it for the
capstone experience.
Beginning Fall 2003, the Electrical & Computer Engineer-
ing Department at Mississippi State University shifted its in- This course/lab combination has undergone several transi-
troductory microprocessor course from a traditional assembly tions and modifications since Fall 2003, moving from instruc-
language orientation (x86-based) to one that emphasizes em- tion focused on an 8-bit microcontroller [10] to more recent
bedded system concepts and hardware/software prototyping efforts centered on a modern 16-bit microcontroller [1].
skills [9]. The course is required for computer science, elec-
trical engineering, computer engineering, and software engi- We considered other approaches, especially the TekBots
neering majors and is 4 credit hours (3 lecture, 1 lab). [11] approach at Oregon State since that has the hands-on,
early microcontroller introduction that we wanted. However,
Students are provided instruction in assembly language the robot platform is fairly expensive as an initial purchase,
programming, but are not expected to become experts. All and we were not going to integrate it across several courses as
assembly language examples are given as code converted from was done at Oregon State. We needed a single course solution,
C language snippets. Assembly language labs are specified as and one that was flexible. The parts kit approach allows us to
C programs, with the students acting as human compilers for easily make changes, both in parts for individual experiments,
implementation. This removes the mystery of the C to assem- and also in the core processor choice. The parts kit also serves
bly language link, and prepares the students for the hardware as a starting kit when students need a microcontroller for the
labs that are implemented entirely in C. Using C for the hard- capstone course. However, during the two-semester capstone
ware labs provides greater code clarity and allows for more course, many teams end up choosing a different processor,
complex examples. Grasping the hardware interfacing issues most commonly one of the same general family but with more
is difficult enough without adding the extra complexity of I/O pins or a different set of on-chip peripherals.
coding applications in assembly language.
When first designing the course, several processor families
The hardware labs cover the onboard peripherals of the were examined. We finally chose Microchip because of their
target microcontroller such as the timer subsystem, I2C inter- traditional support of the hobbyist market with availability of
face, and analog-to-digital converter, as well as off-chip inter- DIP packaging, C compiler support with student versions,
facing to devices such as a serial EEPROM, an I2C digital-to- inexpensive in-circuit programming options, and a strong uni-
analog converter, and an H-bridge/DC motor. The hardware versity program. In 2007 [12], the rankings for microcontroller
labs are built from a parts kit ($65) purchased by the student, sales in the US were (1) Freescale (32%), (2) Renesas (14%),
with wiring done on a protoboard. Figure 2 shows a proto- (3) Microchip (11%), (4) TI (8%), and (5) NEC (8%). World-
board with the first hardware lab connections completed. wide sales ranking for the same period were 1) Renesas
(21%), (2) Freescale (12%), (3) NEC (10%), (4) Infineon
We use the parts kit approach because if a student is
(6%), and (5) Microchip (6%). These rankings are used to
handed a development board with the processor and other
show that using Microchip processors are mainstream in terms
devices on a PCB, then many tend to view it as a monolithic
of industrial acceptance, and have features that are valued by
unit and want to use that same PCB when they need a micro-
that community. From a pedagogical viewpoint, the microcon-
controller for the capstone course. Building a system from a

174
hardware competition team (the hardware competition is this
team's design project for the capstone course). The hardware
competition typically involves autonomous robots performing
some task on a small playing field. Since 2005, after the
course changes from the curriculum change had time to perco-
late to the senior capstone course, the team has placed in the
top three teams several times (1st: 2005 and 2007; 2nd: 2008,
3rd: 2006). Each time the competition has been against 20+
teams (and usually 30+). The SECON success cannot be attri-
Figure 3. Two Photos of Complete Projects, Capstone Course, Fall 2002 buted fully to the microprocessor course change, but we feel
(left), Fall 2001 (right) that the course change has made a substantial contribution. We
had experienced some previous successes in the SECON
troller choice is not that important as long as the microcontrol- hardware competition -- winning it in 2003, and usually fi-
ler is representative of the general microcontroller population. nishing in the top 10, but not with the consistency and high
This type of course revision of rethinking the placement achievement recently demonstrated.
and content of microprocessor courses is hardly unique. Ref- V. CONCLUSIONS AND FUTURE WORK
erence [13] describes a course change at the University of Al-
The ever-growing complexity of microcontrollers chal-
abama, Tuscaloosa that replaced an x86-approach in their in-
lenges the educator while also providing unique abilities to
troductory microprocessor course with an embedded approach
equip students with the ability to create large, complex sys-
using a Freescale MC9S12DP256B microcontroller. Given the
tems. The evolution of the approach developed produced a
increasing capabilities of modern microcontrollers and their
textbook which includes a hands-on laboratory experience.
ubiquitous role in digital systems, it is a natural evolution.
Quantitative results show a significant improvement in the
IV. RESULTS quality and complexity of the resulting capstone design
Since the curriculum change, we have seen a measurable projects, validating this approach.
improvement in the complexity and quality of projects in our REFERENCES
capstone course. Figure 3 shows photographs of two com-
[1] J. Peatman, Embedded Design with the PIC18F452, ISBN: 0-13046-
pleted capstone projects created before the curriculum changes 213-6, Prentice Hall, August 2002, 420 pp.
percolated to the capstone course. The left photo, taken from a [2] R. Tocci, F. Ambrosio, Microprocessors and Microcomputers:
Fall 2002 capston design project, is an electromagnetic field Hardware and Software, 6/E, ISBN: 0-13060-904-8, March 2002, 612
detection circuit with audible buzzer ("SafetyPin") that is built pp.
from simple discretes and ICs. The photo on the right is from a [3] R. Reese, J. W. Bruce, and B. A. Jones, “Microcontrollers: From
'smart light' controller for a second semester capstone design Assembly Language to C Using the PIC24 Family,” Cengage Learning,
team advised by the PI of this proposal from Spring '01 to Fall Dec. 2008, 838 pp.
'01. The team was bootstrapped to minimal competency with [4] R. Barnettt, S. Cox, and L O'Cull, Embedded C Programming And The
the PIC16F873 microcontroller during weekly advising ses- Atmel AVR, CENGAGE Delmar Learning, June 2006, 560 pp.
sions. The microcontroller was programmed in C, but the [5] Han-Way Huang, PIC Microcontroller: An Introduction to Software &
Hardware Interfacing, CENGAGE Delmar Learning, July 2004, 816
overall design and code complexity ended up being equivalent pp.
to approximately one lab exercise in the current microcontrol- [6] Texas Instruments, CC2480: Z-Acell 2.4 GHz Zigbee® Processor,
ler course. This frustrating experience (among many) was one CC280 Datasheet SWRS074A, 43 pp. Available online at
of the drivers for the microprocessor course revision. Figure 1 http://focus.ti.com/lit/ds/symlink/cc2480a1.pdf.
shows a completed project from the Spring 2008 capstone [7] DPAC Technologies, Airborne™ Wireless LAN Node Module Data
course (USB scope with two 60 MB/s capture channels, and Book, 39L3702-01 Rev. D 10/25/2004, www.dpactech.com, 128 pp.
one function generator channel). Complexity differences be- [8] Future Technology Devices International, Vinculum VNC1L Embedded
tween the designs in Figure 1 and Figure 3 are obvious. USB Host Controller IC, Datasheet version 0.97, 2007, 17pp. Available
online at http://www.vinculum.com/documents/datasheets/
For another comparison, of the eleven EE Capstone DS_VNC1L-1A.pdf.
projects for Spring ’02-Fall ’02, three did not include a micro- [9] R. Reese, "Embedded System Emphasis in an Introductory
controller component. Of the remaining projects, about half Microprocessor Course", 2005 ASEE Annual Conference &
Exposition, June 12-15, 2005, Portland, Oregon, poster session.
were programmed in assembly language, with a simplistic
application. Some teams from the Spring' 02-Fall '02 did have [10] R. Reese, Microprocessors: From Assembly to C with the PIC18xx2,
ISBN: 1-58450-378-5, Thomson Delmar Publishing, July 2005, 664 pp.
team members that had taken the elective follow-on microcon-
[11] R. Traylor, D. Heer, and T. Fiez. “Using an Integrated Platform for
troller course and the projects for those teams were more so- Learning™ to Reinvent Engineering Education”. IEEE Transactions on
phisticated. By contrast, of the eleven capstone projects for Education, v46, No 4, 2003, pp 409-419.
Fall ’07-Spr ’08, all had microcontrollers, with applications [12] M LaPedus, "Renesas seeks control of controller arena", EETimes,
written in C, with applications complexity varying from me- March 14, 2008. Available online at
dium to high. http://www.eetimes.com/showArticle.jhtml?articleID=207200324.
[13] W. A. Stapleton, "Microcomputer Fundamentals for Embedded
Another measure of progress is the recent performance of Systems Education", 36th ASEE/IEEE Frontiers in Education
the MSU IEEE Southeastern Conference (SECON) student Conference, Oct. 28-31, 2006, Session M2D.

175

You might also like