Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
ENGR 3390U
Mechatronics
Mini-Project 1
LED Control
S. Nokleby, C. Chan, D. Fischer
1. Introduction
The purpose of this mini-project is to provide an opportunity to learn how to
program a microcontroller.
You will program a common commercial
microcontroller, the HC(S)12 made by Freescale (formerly Motorola). You will
use Metrowerks CodeWarrior CW12 to generate code that will be executed on
the microcontroller.
You are required to program the microcontroller to create three different number
sequences that will display on an inline LED display and a common-anode 7Segment LED display.
2. Hardware and Software
2.1 Hardware
The hardware available for the mini-project includes:
o Laptop Computer
o Freescale (formerly Motorola) HC(S)12 Microcontroller Board
(MC68EVB912DP256) with Microcontroller Chip MC9S12DP256BCPV
o USB Interface and Cable
o Custom Built LED Panel
Figure 1 shows the HC(S)12, the USB interface, and the custom built LED panel
mounted on the mechatronics board. Figure 2 shows a close-up view of the
LED panel.
HC(S)12
USB Interface
LED Panel
DIL1
DIL2
DIL1
DIL2
To Port B
(PB0 to PB7)
2.2 Software
The following software is installed on the laboratory computers and is available to
complete the mini-project:
o Metrowerks CodeWarrior CW12
2.3 Hardware Setup
The Freescale HC(S)12 microcontroller board (MC68EVB912DP256) has
multiple channels for digital I/O, Digital-to-Analog Converter (DAC) processing,
and Pulse Width Modulation (PWM) counter I/O. For more information about the
specification and the use of HC(S)12, please visit:
http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MC9S12DP256B&srch=1
As a quick reference to the data port locations, you can launch the CodeWarrior
IDE from Metrowerks CodeWarrior CW12 (see Figure 3).
From the Toolbar, click on Processor Expert. Then, drag your mouse cursor
and click on View | CPU Types Overview to launch the CPU preview window
(see Figure 4).
PB7
PB6
PB5
PB4
PB3
PB2
PB1
PB0
Common-anode
Hex Display
6
7
You must complete all pre-project requirements before your scheduled lab
time and submit a copy of your pre-project deliverables (one copy per
group) to the TA at the START of your first lab session for this mini-project.
4. Mini-Project Requirements
4.1 Counter
You are required to program the HC(S)12 microcontroller to generate LED
sequences:
title page
group members signing sheet
table of contents
executive summary
project definition
requirements section (state what you must do)
engineering specification section (state the table values appropriate for
controlling the 7-segment display modules)
concept generation section: flowcharts, pseudo-code, program files
(include only the program files in an appendix)
test plan section (to test, you may need a delay procedure so you can see
the various patterns, also you may wish to have a test sequence to make
sure that you can display all digits from 0-9 and not only the once in the
sequnce . State all this in the test section)
discussion and analysis of your prototype demonstration
conclusions
provide as appropriate: freehand sketches, analytical calculations,
references, etc.
4. 4 Submission Requirements
Your submission must comply with the following:
Maximum of 20 pages of project text (1.5 spaced, font Time New Roman,
size 12) excluding appendices and drawings (the number of drawings is
not limited in any way) and a CD/DVD with electronic copies of all files.
Use appropriate project table of contents and formatting. Please state
appropriately the references used (use the following link for guidance:
http://www.ecf.toronto.edu/~writing/handbook.html).
5. Marking Scheme
The overall mini-project will be marked for: completeness, technical merits,
clarity, quality of engineering analysis, feasibility of the proposed design concept,
and the functionality of the prototype.
The report will account for 40% of the mini-project mark. The pre-project
requirements will account for 30% of the mini-project mark. The prototype
demonstration will account for 30% of the mini-project mark.