Professional Documents
Culture Documents
ASEE-GSW 2015 Submission 53
ASEE-GSW 2015 Submission 53
Microcontrollers
Paul E Morton
Electrical and Computer Engineering Department
University of Texas at San Antonio
paul.morton@utsa.edu
Abstract
Students benefit from the hands on use of hardware in a microprocessor course to learn
embedded design principles and to improve their understanding of microprocessors.[1,2,3] Many
options exist for instructors to choose from for hardware to use in an associated laboratory.
However, a purchased development board has the potential to remove the student one more layer
of abstraction from the learning process because of complexity and lack of familiarity with the
hardware. It appears that students studying microprocessors in a first course may see them as
mystical devices, but that having built a lab board from scratch will partially de-mystify the
microprocessor and make learning how to use it easier. Presented is the design of a student
constructed development board, developed at the University of Texas at San Antonio (UTSA)
and used for two semesters for introductory courses in microcomputers for Electrical and
Computer Engineering students. Through-hole construction allows for novice soldering
technique to produce a robust board. Presented are the board schematics, board layout design,
and construction tutorial used in the course. Student feedback in the form of student satisfaction
surveys and comments indicate students strongly felt constructing their board was a good
learning experience and helped boost their confidence in learning how to program the
microprocessor. Example laboratories and lessons learned are discussed. Included are parts
lists and costs while construction tutorial, laboratories and slides are available on line.
Introduction
Teaching microcomputer courses to electrical engineers encompasses a number of inherent
challenges. In the authors view, the biggest of these challenges is that todays students have, by
their use of many high level computing devices, become indifferent to the many layers of
abstraction required for a microprocessor to function and are removed from understanding the
important fundamental knowledge at the actual machine level. Despite having had various
prerequisites that typically include at least an introductory course in programming as well as a
course in logic design, there is still an intellectual void that is manifested by a lack of curiosity
about the deeper layers of abstraction. It is for this reason that it takes a quantum jump in
understanding for most students to realize that actual simple logic gates operating on ones and
zeros can produce the magic like results at the higher levels of abstraction. In an attempt to
bridge this gap the microprocessor course at UTSA has had students assemble their own
microprocessor board from components by hand.
Fig. 1 Previous Perf Board Project Fig. 2 Bare Printed Circuit Board
connected to pin 3 (port RA4) (Fig. 4). The board can be assembled in about 1 hour of soldering
and there is a tutorial on the web that students can use to help make sure all components are
placed correctly. Included on the board are headers connected to the best pin choices for a
number of different interface options including: Universal Asynchronous Receive Transmit
(UART), Inter-Integrated Circuit serial interface (I2C), Serial Peripheral Interface (SPI), a header
for 3 channels of Pulse Wave Modulation (PWM), and a header for 2 channels of analog-to-
digital (A2D) conversion. All of these peripheral modules can be used at the same time without
interference. The only exception is the PWM channel 1, which is shared by the receive (RX)
input of the UART. Since all the components are mounted in a through hole manner, the
soldering is easy for beginners. The best part is that the finished board rarely has problems and
is very durable and robust so that it can be used successfully for a long time. For the few
assembly mistakes, these are easy to debug and fix in lab (Fig. 5). The previous point to point
boards were riddled with problems and the wires were susceptible to shorting out or breaking
with use (Fig. 6).
Labs
Seven labs were conducted using the PIC student boards. The first lab involved just learning
how to write a simple assembly language program and how to use the IDE to load the code on
the chip and how to look at registers in the programmers model to see how instructions change
stored values. The lab also involved hooking up the PICKit3 programmer / debugger and setting
up a general purpose port to blink the LED. Learning objectives for this lab included: 1.
Learning how an instruction works by changing registers in the programmers model and values
in memory. 2. How to create an assembly program in the IDE that configures a pin to drive the
LED on and off. 3. Understanding the need for a delay function. For this lab the delay was
implemented by a counting loop in software. The second lab also used assembly language and
modified the first lab by using a built in timer module for the delay function. This involved
configuring the timer and waiting on the timer flag for the delay interval. The learning
objectives for this lab are: 1. For students to understand how timer modules can be used for
timing events. 2. How to configure the module to give an adequate delay for the blink program
to work. The third lab uses the C++ computer language to program the microprocessor. The
goal was to redo the first lab using a higher level language. The learning objectives for this lab
are: 1. Understand that a higher level language can be used to make programming
microprocessors easier. 2. Understand how C++ can be used in the same IDE as assembly
language. 3. Understand that the higher level C++ code is compiled into assembly language that
is then assembled into machine language and loaded onto the chip. Table 1 lists the details and
learning objectives for all seven of the PIC labs used in the course.
Results
A survey was administered to students at the end of course to assess features of the course as
well as the students view of the PIC boards. Fifty nine boards were completed out of 60 with
one student who did not build his board. Three boards required corrections after construction
involving cold solder joints and one plated through hole problem. There were 4 boards where
the LED was put in backwards. Thirty two students completed the survey anonymously about
the PIC board. There were ten questions with a response scale 5 to 1 corresponding to:
5=strongly agree, 4=agree, 3=no opinion, 2=disagree, and 1=strongly disagree. The questions
are listed in Table 2 in order with the average score for each.
Question
Question Statement Score
#
1 Building the PIC Development Board was a valuable learning experience 4.7
2 I am more confident learning to program the PIC Board because I built it 3.6
3 I felt I could have used the time for more important things 2.4
4 I would be more confident using a commercially built board 2.7
5 I was experienced at soldering before I built the PIC Development board 2.3
6 I would recommend that next semesters class also have to build the board 4.1
7 I felt the cost was reasonable for the boar 4.4
8 I feel building the board increased my understanding of microprocessors 4.0
9 I think the board was about the right level of complexity 3.8
10 I was able to successfully complete my board in reasonable time 3.8
The score on question 1, Building the PIC Development Board was a valuable learning
experience, was extremely high. All students either agreed or strongly agreed with only one
student having no opinion and no dissenters on the value of the learning experience. The score
on the effect of programming confidence (question 2) was 3.6/5. This may have been tempered
by the fact that most students in general feel programming is the hardest part of learning
microprocessors. The questions 3 through 5 were asked in the negative and did show low scores.
The course did include a commercial board for the last 2 labs so students could make a
comparison between both options. The commercial board used was a Freescale Freedom Board
with a KL25Z chip. Most students felt that the board project should be continued next semester
(question 6) and that the $7 cost (question 7) was reasonable. Questions 8 and 9 suggest that the
PIC board increased understanding and was about the right level of complexity. Likewise,
question 10 indicates that the students felt that the time used to build the board was reasonable
also scoring 3.8, the same as the complexity question suggesting agreement about both time and
complexity. Overall the student response was very positive on using the student constructed PIC
board.
Discussion
The very high score on constructing the PIC board as a valuable learning experience is notable.
The fairly strong agreement on questions 2 and 8 in Table 1 I am more confident learning to
program the PIC Board because I built it ; and I feel building the board increased my
understanding of microprocessors , does lend support to the authors hypothesis. The
disagreement on question 4, I would be more confident using a commercially built board , also
supports the hypothesis that the hands-on experience of building the board helps remove some of
the mystique and gives the student more confidence in working with the board. This may be
because this familiarity with the hardware partly helps them connect with lower levels of
Conclusions
Many students stated how much they enjoyed constructing the board and how it did give them a
sense of ownership and connectedness to the microprocessor and to more confidence using the
board in labs. The survey gives strong support to the thesis that building the board, makes
students more comfortable with microprocessors. It does not prove this thesis, because this was
not a random, blinded and controlled trial. Because of difficulties in doing a real level I trial in a
class setting (unfairness of different experiences, blinding problems, free choice and grades), this
is still a useful data point supporting the benefit of a hands on project. The project will be
continued next semester and an additional survey will be done to see if the students continue to
feel the same. The realization that programming is still one of the biggest challenges to the
students requires additional attention. One consistent suggestion from students in written
comments was, to spend more in class time going over the details of each program assignment
line by line. This will be implemented next semester.
Acknowledgement
Special thanks to my student Noland Mantuefel who laid out the board, wrote the list of
materials and made numerous suggestions for improvements.
References
1. Medaris, K Study: Hands-on projects may be best way to teach engineering and technology concepts,
International Journal of Engineering Education, Jan, 2009.
2. Bonwell, C. and Eison, J. (1991) Active Learning: Creating Excitement in the Classroom. Washington, D.C.:
Jossey-Bass.
3. Haury, David L., and Peter Rillero. "Perspectives on Hands-on Science Teaching." Pathways to School
Improvement. The ERIC Clearinghous e for Science, Mathematics, and Environmental Education, 1994. Web. 24
Jan 2012. <http://www.ncrel.org/sdrs/areas/issues/content/cntareas/science/eric/eric-toc.htm>.