Design Projects for Programmable Embedded System on Chip Course
Design Projects for Programmable Embedded System on Chip Course
Prawat Nagvajara received his Ph.D. degree from Boston University, Boston, Massachusetts, in 1989, MS
and BS degrees from Northeastern University, Boston, Massachusetts, in 1979 and 1980, respectively. He
joined the Department of Electrical and Computer Engineering at Drexel University in 1990 where he is
currently an associate professor. His research focus is on application specific computing using custom
hardware and commodity high-performance accelerators and embedded systems education.
Robin Kizirian completed his M.S. degree in Computer Engineering at Drexel University in Philadelphia
and his B.S. degree in Computer Engineering with a minor in Computer Science at the University of
Hartford in Connecticut. He is currently serving as a research assistant at the Engineering Technology
department at Drexel University. Robin has been involved in various projects funded by Pfizer, NASA,
NSF and Department of Education. His areas of research include Embedded Systems, Mechatronics,
Efficient Solar Energy Systems, Internet-based Quality Control and 3-D Online Education.
Page 22.437.1
Abstract
I. Introduction
the concepts behind each of the building blocks when developing real-world
applications7-9. This paper presents three projects: Pulse Width Modulation (PWM) fan
control, gravity measurement, and a wireless traffic light control system. The projects
have been taught as part of an embedded systems course and their materials will be
disseminated on the authors’ institution website for future use by other institutions. The
projects cover real-time software concepts such as interrupts, interfacing with external
sensors and actuators, and digital and analog hardware theories. These projects can better
prepare students for the industry, emphasize the impact of software on the controller’s
architecture, and introduce the use of networking as an engineering tool.
The projects in this paper are based on the CY8C2xxxx family of PSoC1 devices. These devices
can be programmed by using the PSoC Designer software that can be downloaded for free from
the Cypress website11. The software simplifies the coding process by allowing the addition or
removal of components by dragging and dropping the desired digital or analog peripherals. Each
of the building blocks is fully explained and documented in separate PDF documents. After
creating the necessary blocks, the software automatically builds the API libraries to access and
control these blocks. The processor is programmed by using the API libraries and C Language.
The boards that are used in this paper are shown in Figure 1. Figure 1(a) displays the PSoC1
Evaluation board while Figure 1(b) shows the wireless PSoC1 Low Power RF node. Both boards
are Cypress Semiconductor products.
Page 22.437.3
Figure 1(a): PSoC1 Evaluation Kit Figure 1(b): PSoC CYFI Low Power RF Node
III. Pulse Width Modulation Fan Control Project
The system design is shown in Figure 2(a). The fan is equipped with an integral tachometer
which allows the monitoring and controlling of the fan’s speed. The controller utilizes a simple
pulse width modulator to change the width of the pulse provided to the fan and thus, allowing to
change its speed. Although the fan’s speed is calculated by measuring the frequency from the
tachometer, this measurement is only possible when the fan is fully driven. For this purpose, a
tachometer overriding state machine has been programmed into the PWM interrupt handler to
generate an override signal and calculate the speed appropriately. In addition to this setup, an
integrating speed controller has been added to capture the fan’s speed and adjust the PWM duty
cycle to drive the fan with a constant speed. This concept teaches students about closed feedback
loop systems and shows them their significance in adapting to sensitive variations in a system.
Figure 2(a): Schematic for Fan Project5 Figure 2(b): The Implemented Project
Comparing the measured resistance to the look-up table, it is possible to find out the temperature.
Once the temperature is determined, the controller can use the information to modify the fan’s
speed accordingly to keep the system cool. The project is implemented on the PSoC1 Evaluation
Board and is displayed in Figure 2(b).
The project has been setup as in Figure 3(a). A number of Infrared digital sensors, as in Figure
3(b), have been placed in a vertical fashion on a wall. The sensors have been fixed equidistantly
at one foot from each other. They are connected to the general purpose ports on the PSoC board.
A round object is dropped at free fall from the top. Once the ball is dropped, each of the sensors
detects the ball and signals the controller as a general purpose input/output interrupt request to
keep track of the elapsed times at which the ball crossed the sensor. The elapsed times are
gathered within the interrupt handler and later used for calculating the gravitational acceleration
of the ball. The calculations are conducted by utilizing linear regression methodologies and
finding the best linear fit of a Velocity v.s. Time graph.
Page 22.437.5
Figure 3(a): Gravity Measurement Project Setup Figure 3(b): IR Digital Sensor
Figure 4 represents the pseudo code for the controller algorithm. The elapsed times are captured
and calculated in the interrupt handling section. The elapsed times are stored in an array whose
pointer is incremented at every signal from a sensor. Once all the sensors have triggered the
interrupt, the Boolean that signifies the completion of the collection process becomes true. At
this point, the post-data-collection processing takes place. The velocities corresponding to the
elapsed times are calculated and the linear regression technique is applied. The calculated slope
of the regression line is the value of the gravitation acceleration. The value for gravity is finally
displayed on the LCD screen that is provided by the PSoC board.
//Initiation
Distance = Distance between sensors
Collection_Done = False
Start Timer
If Pointer = # of Sensors
Collection_Done = True
//Post-Data-Collection Processing
If Collection_Done = True
Calculate Elapsed times from Array
Calculate Velocities corresponding to Elapsed Times
Apply Linear Regression Technique
Gravity = Slope
Table 1 displays sample gravity measurements data and the corresponding best linear-fit graph.
As can be seen, the slope of the line is 31.659 ft/s2 which is approximately equal to the average
gravitational acceleration of 32.2 ft/s2.
0.257 7.8345
10
0.366 11.9256 y = 31.659x + 0.0085
5 R² = 0.9955
0.458 14.2693
0
0.535 17.4754 0 0.2 0.4 0.6 0.8
Elapsed Time (Seconds)
0.597 18.5344
The main project in the embedded systems course involves designing a wireless traffic-light
controller. This project presents the concepts of network protocols and topologies and their usage
as engineering tools. It combines these networking tools with microcontroller technologies to
develop an integrated wireless embedded design. Using PSoC devices for wireless embedded
systems provides the advantage of fewer components and shorter design cycles. PSoC utilizes
Page 22.437.7
the CyFi Star Network Protocol11 as the basis for its wireless system. The protocol is portrayed
in Figure 5. In the star network topology, packets are transmitted back and forth between the
nodes and the centralized hub. These communications are bidirectional and take place as from
node to hub or hub to node. Up to 250 nodes can be connected to one hub. The nodes and the
hub are implemented using wireless PSoC1 devices and are powered using two AAA batteries.
In each of the wireless components, the PSoC device executes the network protocol, runs the
programmed application, and drives the CyFi transceiver. The CyFi transceiver features a 2.4
GHz RF (Radio Frequency) solution and is controlled by an active power management system
for low power communications among the wireless components. Figure 6 displays the proposed
system design for the wireless traffic light controller. The system consists of two nodes and a
hub. On one side, the sensor node interfaces with analog proximity sensors, collects traffic
information, and then transmits it to the hub. The hub correspondingly forwards the information
to the traffic light controller node. The traffic light controller node sends a signal to a PSoC1
traffic light controller board to either maintain its state or change it accordingly.
Traffic Controller
Wireless Hub
Distance Infrared
Sensors
Page 22.437.8
Cypress has included the Application Programming Interface (API) for its CyFi topology to
simplify the control of its Star Network Protocol. Before packets can be transmitted among the
nodes, each of the nodes has to be bound with the hub. The binding process is started by the hub
when it initiates its listening process to any requesting nodes. The nodes then connect to the hub
by requesting to be bound and registering their device IDs. This means that the hub stores all the
nodes’ device IDs; however, the nodes do not know each other’s IDs. After the nodes are bound,
the network has been established and data can be transferred. Figure 8 demonstrates the different
stages through which a packet traverses when it is transmitted from the sensor node (Node 1) to
the control node (Node 2). At the sensor node, the packet is programmed to include the control
node’s device ID in its payload. The packet also contains the traffic information data that the
sensor node is planning to send to the control node. Since CyFi utilizes a star network protocol,
the packet has to be sent to the hub initially before it is forwarded to its destination. Thus, the
header information indicates that the sender is the sensor node and the receiver is the hub. When
the packet arrives to the hub, the hub determines the packet’s destination from its payload. It
creates a new packet which includes the sender’s device ID and a copy of the data in its payload.
At this stage, the header information indicates that the sender is the hub and the receiver is the
Page 22.437.9
control node. Once the packet arrives at the control node, the node identifies that the sender is
the sensor node and then analyzes the data that it has received.
The overall system has been setup in a laboratory environment at the author’s institution. Figure
9 displays the implemented wireless traffic light controller and highlights the different sections
of the system.
Traffic
Lights
Control Sensor
Node Node
Relay
System
Analog IR Sensor
Hub
Traffic
Controller
Page 22.437.10
The students in the embedded systems course were presented with pre-course evaluations
to determine their strengths and weaknesses prior to performing the laboratory
experiments that accompany the course. After being taught the programmable system-on-
chip technology and getting involved in the projects, the students were asked to complete
the same course evaluation questionnaire.
The questionnaire targets the students’ understanding of the course materials and
measures the enhancement in the learning of embedded systems concepts and
applications. The evaluation questionnaire is the same for pre- and post-evaluations and
is displayed in Figure 10.
The pre- and post-course evaluation results are presented in Figures 11 and 12. The final
results demonstrate a marked increase in the students’ understanding of microcontroller-
based technology and embedded systems. By using programmable system-on-chip
devices, the students gained experience in designing systems composed of both hardware
and software components. Their understanding about sensors and actuators in addition to
their knowledge in computer architecture, interrupts, and mixed signal systems drastically
improved.
1 2 3 4 5
Survey Question Least like Not Neutral Like Most
me like me me Like me
1. I have experience working with software O O O O O
program interfacing with hardware.
2. I understand how embedded systems and O O O O O
microcontrollers are applied to engineering
problems.
3. I have experience designing systems that O O O O O
have hardware and software components.
4. I have used design automation tool that O O O O O
integrates programmable hardware and
software development.
5. I understand how software programs O O O O O
interface with sensors and actuators.
6. I have knowledge in computer architecture O O O O O
and organization, and assembly language.
7. I have used interrupts and interrupt service O O O O O
routines in real-time software.
8. I have worked with mixed-signal systems O O O O O
(digital and analog).
9. I design embedded systems with design O O O O O
stages and debugging plan.
10. I am prepared for career in embedded O O O O O
systems design.
Page 22.437.11
Percentage of Students
60
50 Most Like Me
40
Like Me
30
Neutral
20
Not Like Me
10
0 Least Like Me
1 2 3 4 5 6 7 8 9 10
Question
Post-Course Evaluations
70
Percentage of Students
60
50 Most Like Me
40
Like Me
30
Neutral
20
Not Like Me
10
0 Least Like Me
1 2 3 4 5 6 7 8 9 10
Question
VII. Conclusion
Enhancing microcontroller teaching techniques is important for insuring quality and up-to-date
education for future generations of electrical and computer engineers. The paper proposes the
integration of programmable system-on-chip technologies into microcontroller learning.
Programmable system-on-chip devices, such as the Cypress PSoC boards, have been utilized in
the authors’ institution for the laboratory experiments of an embedded systems course. These
devices offer programmable digital and analog blocks that introduce the students to the different
digital and analog design criteria and provide them with a better hands-on industry-like
experience. Three main projects were incorporated into the course, each of which targeted a
specific field of embedded systems learning. Based on an evaluation questionnaire completed by
Page 22.437.12
each student at the beginning and end of the course, significant improvement in student learning
(and understanding of microcontroller-based concepts and their integration into embedded
systems) was noted. Integrating PSoC devices into microcontroller coursework appears to be of
great benefit in electrical and computer engineering education.
References
[1] Mar, M., Sullam, B., and Blom, E., “An Architecture for a Configurable Mixed-Signal Device”, IEEE Journal of
Solid-State Circuits, Vol. 38, pp. 565-568, March 2003.
[2] Fang, W., Kedar, S., Owen, S., Wei, G., and Brooks, D., “System-on-Chip Architecture for Intelligent Sensor
Networks,” Proceedings of the 2006 International Conference on Intelligent Information Hiding and Multimedia
Signal Processing(IIH-MSP’06), Pasadena, CA, December 18-20, 2006.
[3] Faura, J., Horton, C., Krah, B., Cabestany, J., Aguirre, M.A., and Insenser, J.M., “A New Field Programmable
System-on-a-Chip for Mixed Signal Integration”, Proceedings of the European Design and Test Conference
(ED&TC’97), Paris, France, March 17-20, 1997.
[4] Wallner, S., “Design Methodology of a Configurable System-on-Chip Architecture”, Proceedings of the 12th
Annual IEEE Symposium on Field-Programmable Custom Computing Machines (FCCM’04), Napa, CA, April 20-
23, 2004.
[5] D. Van Ess, E. H. Currie, and A. Doboli, “Laboratory Manual for Introduction to Mixed-Signal, Embedded
Design”, ISBN 978-0-9814679-1-7
[6] Seguine, D., “Just Add Sensor – Integrating Analog and Digital Signal Conditioning in a Programmable System
on Chip”, Proceedings of IEEE Sensors, Vol. 1, pp. 665-668, November 2002.
[7] Hall, T., and Hamblen, J., “System-on-a-Programmable-Chip Development Platforms in the Classroom”, IEEE
Transactions on Education, VOL. 47, No. 4, November 2004.
[8] Nurmi, J., Madsen, J., Ofner, E., Isoaho, J., and Tenhunen, H., “The SoC-Mobinet Model in System-on-Chip
Education”, Proceedings of the 2005 IEEE International Conference on Microelectronic Systems Education
(MSE’05), Anaheim, Ca, June 12-14, 2005.
[9] De Man, H., “System-on-Chip Design: Impact On Education and Research”, IEEE Desgin & Test of Computers,
Vol. 16, Issue 3, 1993.
[10] D. Montgomery, E. Peck, and G. Vining, “Introduction to Linear Regression Analysis”, ISBN: 978-
0471315650