EE345L Microprocessor Applications and Organization Spring 2002
Office Hours: Mon. 10-10:45am, Wed. 12-2pm, Fri. 9-10am, Fri 1-2
Special Office Hour (Optional Recitation) : ENS127 Friday 11:00 am to 11:50 am
Office Hours: Mon. 10-10:45am, Wed. 12-2pm (in ENS252C), Fri. 9-10am
Instructor: Jonathan W. Valvano, ENS617A, 471-5141, Lab ENS619/621 (1-1216)
email valvano@uts.cc.utexas.edu
Web page http://www.ece.utexas.edu/~valvano
Lab: ENS252C Unique Numbers: 14690 Th9-12, 14695 W12-3, 14700 W3-6, 14705 Th3-6, 14706 T3:30-6:30,
14710 W7-10, 14688 T7-10
EE345L and EE345M TAs:
Anand Rajan, arajan@ece.utexas.edu, Tue, 9-12, Tue 7-10,
(HEAD TA)
Anil Kottam, kottam@ece.utexas.edu, Wed 3:30-6:30
Hyunjin Shin, hjshin@ece.utexas.edu, Tue 3:30-6:30, Thur
7-10
Chia-ling Wei, clwei@mail.utexas.edu, Thur 3-6
Jignesh Shah, jignesh_s@softhome.net, Wed 7-10, Thur 9-12
Divyashree Sundaresha, divyashree_s@yahoo.com, Wed 12-3
Reference materials: Data sheets for most of the devices used in this class are available
as pdf files on the lab network and on the CD. Please make sure
you have access to the MC68HC812A4 Technical Summary, and the
MC68HC812A4 Electrical Specifications
Text: Embedded Microcomputer Systems, Brooks-Cole 2000, by J. W. Valvano
IEEE Parts:
1 prototype board per student (2 per group)
Lab supplies: resistors, 3.5 inch floppy disks, wires
HKN: Spring 2002 EE345L Laboratory Manual by J. W. Valvano
Other references: For programming in C and digital logic, see the EE360C and EE316 texts
Also see Kelly/Pohl, A Book on C, Benjamin Cumming Publishing
Prerequisites: EE321, EE316 and EE319K. There will be no re-tests, make-ups, or incompletes.
Specific Objectives of EE345L
Microcomputer Architecture (EE319K review)
An Introduction to the Microcomputer, Computer Architecture,
The 6812 Instruction Set, 6812 Addressing Modes, 6812 Instructions,
Organization of the M68HC12, Notation for Block Diagrams, MC68HC812A4
I/O and Memory Organization, The Memory Map of the MC68HC812A4
Programming Microprocessors (EE312, EE322 review)
Data Structures in C, Indexable Data Structures, Sequential
Data Structures, Writing Clear Programs in C, Documentation, Programming
Style, Subroutines and Arguments in C, Passing Parameters (Conceptual
Level), Passing Parameters (Implementation Level), Calling and
Returning Mechanisms, A Blueprint for Writing Subroutines, Subroutine
Documentation
Microcomputer Bus Interfaces
Digital Hardware, Modules and Signals, Drivers, Registers
Timing equations, timing diagrams,
Address decoding, PROM, RAM interface
Parallel and Serial Input-Output
Simple I/O Devices, Basic Input and Output Devices, Input-Output
Software, I/O Transfers and Buffered Input and Output, Programmed
Logic Control, Table and Linked List Interpreters, Programmable
Parallel Input-Output Devices, Problems with LSI I/O and the Ritual,
M6812 Single-Chip Parallel Input-Output Registers, Indirect Input-Output,
Synchronous Serial Input-Output, Serial I/O Chips, Control of
Serial I/O Chips Using a Parallel Port, The MC68HC812A4 Serial
Peripheral Interface
Interrupts and Alternatives
Synchronization in I/O devices, Synchronization Principles
of I/O Devices, Synchronization Mechanisms for the M6812 Parallel
Ports, Slow Synchronization Mechanisms, Real-Time Synchronization,
Gadfly Synchronization, Single Interrupts, Polled Interrupts,
Vectored Interrupts, Vectored Interrupts in the M6812
Parallel Port Interfaces
Keyboards, Key Debouncing, Keyboard Scanning Techniques, LED's
and LCD's
Communication Systems
Communications Principles, Signal Transmission, UART Link
Protocol, UART Transmission and Reception by Software, Serial
Communications Interface System in the 6812
Special Topics
About 1-2 weeks each semester will be allocated to cover special
state-of-the-art topics involving embedded microcomputers and
their applications.
Attendance: Students are expected to attend lectures. The book
covers more information than the class and we will use lectures
to map our way through the book. If you miss class you may find
it difficult to catch up.
Grading: 40% Laboratory
15% In class Quiz1, open book, Wednesday, March 6, 11:00
am to 11:50 am, in regular class room
15% In class Quiz2, open book, Wednesday, April 10, 11:00
am to 11:50 am, in regular class room
30% Final, open book, Wednesday, May 8, 9am-12noon, regularly
scheduled
Your grade will be assigned on the usual 60, 70, 80, 90 basis.
An average above 70 is required to receive a credit (CR/NR).
Lab Partners: All labs should be performed with a partner. The
lab partnership must be registered with the TA (a simple hand
written note signed by both students will suffice) at least a
week before the assignment is due. Once registered, the partnership
will continue. A partnership can be dissolved only after discussion
with the TA. Both partners must be present during the demonstration.
It is expected that both partners will contribute to all aspects
of each lab, and both partners are expected to be present during
the check out. The point values are the same for all labs. The
TA will sign your software listing when you demonstrate your system.
All parts of the assignment must be demonstrated to a TA by the
end of your lab period the week shown in the column labeled "Demo/Report".
The report (hardware/software/data plots) are due one day after
the demonstration is due. Please consult with your TA for specific
due dates for your lab section.
Laboratories
1b. SCI serial port drivers, decimal fixed point input/output
2b. Functional debugging
2c. Performance debugging
3b. LCD Watch
Parallel I/O lab (Lab 4b or 4c)
4b. Traffic Light,
4c. Stepper Motor
5b. Interrupting Keyboard Interface (2 weeks)
6b. Synchronous serial I/O, Graphics interface using a DAC
7b. RAM interface (2 weeks)
8b. Position Measurement
EE345L Laboratory Schedule (see your TA for the latest)
Week
Quiz
Preparation
Demo/Report
Comments
1/21
none
none
none
demonstration, partners chosen
1/28
1b
1b
none
2/4
2b
2b
1b
2/11
2c
2c
2b
2/18
3b
3b
2c
2/25
none
none
part
demo first part of 3b
3/4
4b/4c
4b/4c
3b
3/18
5b
5b
4b/4c
3/26
none
none
part
demo first part of 5b
4/1
6b
6b
5b
4/8
7b
7b
6b
4/15
none
none
part
demo hardware part of 7b
4/22
8b
8b
7b
4/29
none
none
8b
Turn in equipment by 5/3
During the week of January 21, please go to your regularly scheduled
lab in ENS252C to hear a TA explain the lab grading policy. If
you miss your section, go to one of the other sessions. ImageCraft
Adapt812 boards will be passed out and lab partners will be selected
in your lab the week of January 21-25. The Lab 1 preparation is
due at the beginning of your lab the week of January 28-February
1. Preparation includes hardware wiring diagrams and syntax-free
software printouts. In other words, please type your software
into the PC before lab. The lab preparations (hardware diagrams
and syntax-free software source code printouts) are due at the
beginning of your lab period. Attendance in lab is required. All
software for lab, and tests must include comments. All hardware
must include R&C values specifying tolerance and type (e.g., 5%
carbon), and TTL chip numbers (be very specific e.g., 74LS00).
Pin numbers are required only for lab, not for the exams.
Students are encouraged to go to the last 2 hours of the other
lab periods (including when EE345M labs are scheduled), but the
first priority will be to the regular students. Because of the
lab quiz, the first hour of lab is restricted to the regular students.
CLEAR OUT BY 15 minutes before the start of lab. At the end of
the semester please verify with the checkout counter that your
record is clear. All reports must be given to the TA by Friday
May 3, 12 noon.
Date
Chapter
Topic
1/14
1, 2
EE319K review, 6812 introduction, 6812 registers, ALU, CU, BIU, EAR, IR, RAM EEPROM, show LED1.c
using ICC12
1/16
2
Lab environment, run SCIDEMO.c on actual Adapt812 board, example
decimal fixed point, debugging techniques
1/23
2
programming style guidlines for this class, modular programming,
call graphs, flow charts, data flow graphs, use SCIdemo as example
1/28
2
Run SCIDEMO.c and Huff.c on TExaS, reenforce debugging techniques,
and programming style, dumps, monitor,
1/30
2,3
Draw pictures showing elements on the stack (show figures in embed.html),
debugging from an assembly language perspective, real time systems
2/4
3,4,8
run rti.c on Adapt 812, profiling, LCD Displays, HD44780 controller, blind cycle versus gadfly
synchronization, fixed time delay using TCNT
2/6
3,4
interface binary switch using pull-up resistor to an input port,
draw flowchart of rti.c, run rti.c on TExaS, profiling with the scope showing just how small a percentage
of time is spent in the background, simulation of the rti instruction,
globals/locals, static variables, threads, draw thread trace of
rti.c, show how to maintain time of day in rtihan, allocation
of tasks between the foreground and background
2/11
8
LED interfacing using a 7405, linked data structures, ROM-based structures using const, finite
state machines, run Moore12.c, adding output pins, adding input pins, running
the FSM in the background using rti interrupts
2/13
8
FSM with functions, traffic example, Stepper Motors, full step
versus half step algorithm, stepper motor interface electronics
(7406, 75492, TIP120, IRF540), snubber diodes
2/18
4,6
thread communication using a fifo queue, producer/consumer problem,
real-time system, I/O bound versus CPU bound, fsm running in the
background using output compare interrupts
2/20
4
Interrupt synchronization, key wakeup
2/25
4
thread synchronization, reentrancy
2/27
8
Switches and Keyboards
3/4
8
Switches and Keyboards
3/6
Quiz 1 in class, covering material in Labs 1b,2b,2c,3b
3/18
2,4
Profiling, dumping, debugging interrupt software
3/20
4,6
Periodic polling with Output compare
3/25
7
SPI/DAC interface
3/27
7
Serial Communications
4/1
7
Serial Communications
4/3
9
Memory interfacing, timing diagrams
4/8
9
PROM interface, RAM interface
4/10
Quiz 2 in class, covering material in Labs 4b,4c,5b
4/15
11,12
ADC and data acquisition
4/17
11,12
ADC and data acquisition
4/22
Industrial guest speaker
4/24
7,14
networks
4/29
14
networks
5/1
Review, course evaluation
5/3
All Lab notebooks are due to the TA at 12 noon
5/3
Turn in Lab Equipment so that Mona wont bar your registration
5/8
Final exam, 9am-12noon, Room regularly scheduled
Legal Stuff: The 12th class day is January 30. After this date, I will sign
a drop only if the Dean approves it. Your current grade status
must be a "C" or better for you to receive a "Q". Course evaluation
is conducted on the last class day in accordance with the Measurement
and Evaluation Center form. The final exam is at the time and
place stated in the course schedule. The University of Texas at
Austin provides upon request appropriate academic adjustments
for qualified students with disabilities. For more information,
contact the Office of the Dean of Students with Disabilities at
471-6259, 471-4241 TDD.
Cheating: Cheating is very uncivilized behavior and is to be avoided at
all cost. You are allowed to talk to your classmates about the
lab assignments, but you are NOT allowed to look at each other's
written work. Oral discussion about an assignment is encouraged
and is not ?considered to be cheating. Copying of any part of
a program is cheating without explicit reference to its source.
If we find two programs that are copied, there will be a substantial
penalty to both students, e.g., failure in the course. Students
who cheat on tests or in lab will fail. Prosecution of cases is
very traumatic to both the student and instructor. PLEASE DO YOUR
OWN WORK. Policies concerning the use of other peoples' software
in this class:
I strongly encourage you to study existing software.
All applications and libraries must be legally obtained. E.g.,
You may use libraries that came when you bought a compiler.
You may use software obtained from a BBS or on the WWW.
You may copy and paste from the existing source code.
You may use any existing source code that is clearly referenced and categorized:
original: completely written by you,
derived: fundamental approach is copied but it is your implementation,
modified: source code significantly edited to serve your purpose,
copied: source code includes minor modifications.
Places to buy prototyping boards and other parts
In Austin
AlTex Electronics
832-9131
Tinkertronics
719-3560
Howard Electronics
837-2525
Mail Order
BG Micro, Dallas
1-800-276-2206
www.bgmicro.com
All Electronics, Los Angeles
1-800-826-5432
www.allelectronics.com
Marlin P. Jones
1-800-652-6733
www.mpja.com
TechAmerica, Fort Worth
1-800-877-0072
Hosfelt, Steubenville, OH
1-888-264-6464, 1-800-524-6464
Jameco, Belmont CA
1-800-831-4242
www.jameco.com
When studying, focus on the topics that apply to the 6812 and the topics included in the lab assignments.
You will find old quizzes and finals with solutions on the class web site.
STUDY GUIDE for Quiz 1
Lab Important Topics
1b SCI port, RS232 drivers, software device driver, data
flow graphs
2b,2c Hardware/software debugging techniques,
instrumentation, profiling,
linked binary tree, encoding
3b Parallel port handshake,
bidirectional data communication,
foreground/background
real time interrupt
Chapter Topic
1-2 6812 architecture and assembly language,
interpreting output of the C compiler
(parameters, locals globals, critical sections)
C programming (const, static, volatile, long,
#define, #pragma abs_address:0xfffe)
3 parallel ports, direction registers, open collector,
input/output currents input handshake,
output handshake, bidirectional interface
4 RTI interrupts
8 LCD interfaces
Guarantees
device driver software
RTI interrupt software
debugging concept/implementation, data structure
STUDY GUIDE for Quiz 2 (Quiz 1 stuff plus the following)
Lab Important Topics
4b,4c Finite state machine, statically allocated linked structures,
segmentation, abstraction, stepper interface
switch inputs, LED outputs, accurate time delays
5b Keyboard scanning, interrupts, open collector,
software device drivers, fifo queues,
critical sections, real time profile
multithreaded distributed software system,
Chapter Topic
2 statically allocated linked lists, interpreters
3,4 Choosing between real time, gadfly,
interrupts, periodic polling, DMA
4 Interrupts, latency, key wakeup, fifos
periodic polling,
vectored vs polled interrupts,
6.2.3 Output compare periodic interrupt
8 Keyboards, debouncing, scanning,
LEDs, relays, stepper motors
Guarantees
abstraction,
interrupt software: key wakeup, TOF, RTI, or SCI
high current interface (from Chapter 8)
STUDY GUIDE for Final (Quiz 1, Quiz 2 stuff plus the following)
Lab Important Topics
6b SPI, DAC, software device drivers
7b memory interfacing,
8b ADC, data acquisition
Chapter Topic
7 serial devices
SPI interfacing,
SCI, interrupts, RS232, RS422, full duplex,
half duplex, simplex,
bandwidth, synchronization with printers
9 memory interfacing, timing diagrams
11 built-in A/D converter
14 Networks, message protocols, layered approach,
concept of parallel port network using tristate logic,
concept of parallel port network using open collector logic,
handshake,IEEE488 bus
Guarantees
interrupt software: key wakeup, TOF, RTI, SCI or SPI,
memory interface,
network interface/synchronization
Curious about my research? See
http://www.ece.utexas.edu/~valvano/research