EE345M Embedded and Real-Time Systems Lab (version 3/23/08)
Class: BUR108, Monday, Wednesday 10-10:50am
Recitation: BUR108, Friday 10-10:50am
Office Hours: Monday 2:15-3, Wednesday 12:00-12:45, Friday 11:15-12noon
Instructor: Jonathan W. Valvano, ENS627, 471-5141
email valvano@mail.utexas.edu   (put "EE345M" in the email title, send no ZIP files)
Web page http://users.ece.utexas.edu/~valvano 
Unique Numbers:
16135 MW 11:00AM-12:30PM, Sandy Hermawan
16140 MW 12:30PM-2:00PM, Seil Oh
16145 MW 2:00PM-3:30PM, Seil Oh and Sterling Wei
16150 MW 6:30PM-8:00PM, Sterling Wei
16155 TTh 6:30PM-8:00PM, Robin Tsang
16160 TTh 8:00PM-9:30PM, Robin Tsang
Text: Embedded Microcomputer Systems: Real Time Interfacing, 2nd Edition, ISBN 0534551629, Thomson 2006, by J. W. Valvano
Great TAs:                 
Robin Tsang, rtsang@ece.utexas.edu  (head TA)
Seil Oh , Seil_O@hotmail.com 
Sandy Hermawan, seki_ray83@yahoo.com
Sterling Wei, sweitx@gmail.com
Lecture notes and lab manual
Lectures and lab manual 
Reference materials: Data sheets for most of the devices used in this class are available as pdf files on the class website. See http://users.ece.utexas.edu/~valvano/Datasheets  Data sheets for devices used in EE345L
http://users.ece.utexas.edu/~valvano/Starterfiles  Starter files for EE345L and EE345M
http://users.ece.utexas.edu/~valvano/metrowerks/  Description of Starter programs
http://users.ece.utexas.edu/~valvano/Datasheets/MC9S12C128_V1.pdf  9S12C32 data sheet
http://users.ece.utexas.edu/~valvano/embed/toc1.htm  C programming manual
http://users.ece.utexas.edu/~valvano/Starterfiles/TechArts.zip  Data sheets about board
Old Exams http://users.ece.utexas.edu/~valvano/EE345Moldquiz/ 
Other references: For programming in C, see the EE312 text or
      Also see http://users.ece.utexas.edu/~valvano/embed/toc1.htm    
Prerequisites: EE345L or EE345S. There will be no re-tests, make-ups, or incompletes.
Teaching philosophy
I strongly encourage students to take an active role in this class.  Questions are welcome before, during and after class. Please feel free to email, visit or call me if you have questions.
Specific Objectives of EE345M
The primary objective of EE345M is for the students to develop the ability to design real-time systems. This class allows students to combine principles of microcomputer interfacing, software development, digital logic and analog circuits into the design of microcomputer-based systems.
Review of 9S12 architecture, and C programming
Synchronization methods
    Busy-wait, interrupt, DMA, periodic polling, priority interrupts
Review of Microcomputer Bus Interfaces
    Timing equations, timing diagrams,
    Address translation and extended mode
Embedded Communication Systems
    Serial network protocols, layered software, USB
Real time operating systems
    Foreground and background thread scheduling
    Synchronization using spinlock and blocking semaphores
    Interthread communication
Digital Device Interfaces
    Diodes, transistors, DC motors, servos, stepper motors, relays, solenoids,
    Optical sensors and optical isolation
Time Domain Interfaces
    Input capture/output compare, frequency, period and pulse width measurements,
    Pulse-width modulation
Data Acquisition Systems
    Op amp amplifiers, DAC, ADC, Thread scheduling, digital filters
Control systems
    Open loop and closed loop, Linear and Nonlinear,
    Bang-bang, incremental, PID, Fuzzy Logic Control
After the successful conclusion of EE345M students should be able to design real-time embedded systems, such as motor controllers, data store systems, data acquisition systems, communication systems and robotic systems.
Grading: 40% Laboratory
    15% Quiz1, Friday February 15, 10-10:50am, in ART 1.102
    15% Quiz2, Friday April 4, 10-10:50am, in ART 1.102
    30% Final, Saturday May 10, 7-10pm, regularly scheduled
I have no expected grade cutoffs or expected GPA for this class. You can view the previous GPAs for most of your classes at UT (Pick-A-Prof reports I give a GPA in this class of 3.43).  All professors want a 5 on their teaching evaluation, and all students want an A. However, I feel both should only be awarded for excellence. 
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.
Lab Partners: All labs should be performed with a partner. The lab partnership must be registered with your 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". Any EE345M TA is authorized to checkout your lab.  The report (hardware, software, data and plots) are due one day after the demonstration is due. Please consult with your TA for specific due dates for your lab section.
EE345M Laboratories
25b. Solid state disk, SPI, address translation, layered software, file system
22b Audio recording and playback
10e. Distributed data acquisition using a controller area network (CAN)
16. Real-time digital scope and spectrum analyzer using a USB interface 
18. Real-time operating system
Competitive Soccer Robot  (teams of 3 or 4)
       30A. Motor interface and PID control
       30B. Steering, and sensor design and interfacing
       30C. Control algorithm, system performance analysis
 

Lab Schedule

Week

First session

Second session

Friday 10am

Comments

1/14

none

none

 

no lab activities

1/21

Meet the TA

partners chosen

 

Metrowerks demonstration

1/28

25b Prep

25b Demo

25b Report

Spectrum analyzer demo

2/4

22b Prep

22b Demo

22b Report

 

2/11

10e Prep

 

 

quiz 1 is 2/15

2/18

 

10e Demo

10e Report

 

2/25

16 Prep

16 Partial Demo

 

Demo 9S12-USB output

3/3

 

16 Demo

16 Report

 

3/17

18 Prep

 

 

 

3/24

 

18 Prep

18 Report

 

3/31

30A Prep

 

 

quiz 2 is 4/4

4/7

 

30A Demo 

30A Report

 

4/14 30B Prep    

 

4/21

30B Demo

30C Prep

30B Report

 

4/28

 

30C Demo

30C Report

Turn in equipment by 5/2

No lab 1/21

Prep = you turn in your lab preparation
Demo = you demonstrate your lab to the TA
Partial = you demonstrate first part of a two-week lab to the TA
Report = you turn in your complete lab report to the TA
 

Date

Chapter

Topic

1/14

2, 4, 7

view01, Modular programming, call graphs, flow charts, data flow graphs, show differences between SCI12.C and SCI12A.C, Metrowerks compiler, device drivers, quality software, friendly

1/16

2, 4, 6

view02, Lab environment, 6812 debugging techniques, intrusiveness, monitor, output to scope, TExaS simulator, real time

1/23

7, 11

view03, PLL, OC interrupts, SPI interface, EEPROM, file system

1/28 11, 12

view04, microphone interface, rail-to-rail single supply circuits

1/30

11

view05, ADC software, data acquisition systems

2/4

14

view06, Controller area network, FIFO queue

2/6

14

view06, Controller area network, layered software

2/11

15

view07, Digital filters, Z transform, fixed point implementation, effect of sampling jitter

2/13

14 view08, USB

2/15

 

Quiz 1 in ART 1.102, covering material in Labs 25b, 22b, digital filters 

2/18

14

view09, Visual C++ example 

2/20

 

view10, FFT, graphics

2/25

5, 6

view11, threads, TCB switching, run Lab17.c on TExaS Spinlock semaphores, draw initial TCB, performance measures (response time, throughput)

2/27

5

Debugging using output pins, Blocking semaphores, use of the FIFO, and thread communication, add cooperative multitasking to Lab17os.c

3/3

5

view12, Blocking semaphores, priority scheduling

3/5 5 view13 OS

3/17

8

view14, Transistor interfaces (TIP120, L293, IRF540), optical isolation, motor interfacing

3/19

6

view15, Pulse width modulation, using output compare, Input capture

3/23

6

view16, Input capture, simple period measurement

3/25

13

view18 Control systems, PID control systems   

3/31

 

view19, Team work and the design process

4/2

 

Quiz 2 review

4/4

 

Quiz 2 in ART 1.102,  covering material in Labs 25b, 22b, 10e, 16, 18

4/7

13

view17 FSM, bang-bang, incremental

4/9

13

view20, Fuzzy Logic Control Systems  

4/14  

view21, Choosing a microcontroller 

4/16

   

4/21

9

view22, Timing diagrams, 6812 bus timing, RDA RDR, WDA WDR

4/23

9

view23, 6812 extended RAM interface, DPAGE address translation,  

4/28

 

course review and evaluation

4/30

 

Robot demonstrations in ENS lobby

5/2

 

all Lab notebooks are due to the TA at 12 noon

5/2

 

Turn in Lab Equipment so that Mona won't bar your registration

5/10

 

Final exam, Saturday, 7-10pm, Room regularly scheduled

     No lab activities occur during the week of January 14.  During the week of January 22-24, please go to your scheduled lab sessions in ENS252C to get a demonstration of the lab equipment.  If you did not get a TechArts 9S12C32 kit in EE319K, then a kit will be given to you. Each student will get exactly one kit. If you loose it or destroy it, you can purchase another from Technological Arts for $50 plus shipping. For more information on purchasing a replacement kit, go to the http://www.technologicalarts.com/  web site and order NC12C32SP. Lab partners will be selected in your lab the week of January 22-24. The Lab 25 preparation is due at the beginning of your lab the week of January 28 or 29.  The lab preparations (hardware diagrams and syntax-free software source code printouts) are due at the beginning of your lab period. In other words, please type your software into the PC before lab. 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 1 hour of the other lab periods, but the first priority will be to the regular students. During the first 15 minutes of lab, the TA will collect preparations. For the next 15 minutes, the TA will lead a lab discussion session. The remaining lab time is available for debugging and lab checkout. 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 2, 5pm.

Sections from the book required to perform the labs

1.6. Digital Logic And Open Collector
2.11. Debugging Strategies
4.5.4. 6812 Interrupt Vectors And Priority (Review)
7.6. SCI Interrupt Interfaces
7.7. SPI Interfaces
Lab Example SCI12.H SCI12A.C (Review)
8.4. Transistors Used For Computer Controlled Current Switches
8.5.5. Pulse Width Modulated DC Motors
8.5.6. Interfacing EM Relays, Solenoids, And DC Motors
Figure 8.70 (IRF540, 6N139)
6.2.1. General Concepts
6.2.2. Output Compare Details
6.2.3. Periodic Interrupt Using Output Compare (Review)
6.2.5. Pulse Width Modulation
6.1.1 Basic Principles Of Input Capture
6.1.2. Input Capture Details
6.1.3. Real Time Interrupt Using An Input Capture
6.1.4. Period Measurement (Not 32-Bit)
6.4.1. Using Period Measurement To Calculate Frequency
5. Threads (6812, but not 6811)
14.1., 14.3(2nd edition) CAN Network
15. Digital filter fundamentals, design, implementation and analysis
Covered on the exams, but not necessary for the labs
6.1.5. Pulse Width Measurement
6.3. Frequency Measurement
6.3.1. Frequency Measurement Concepts
6.3.2. Frequency Measurement with frequency resolution of 100Hz
6.5. Measurements Using Both Input Capture And Output Compare
6.5.1. Period Measurement with period resolution of 1ms
6.5.2. Frequency Measurement with frequency resolution of 0.1Hz
9.7.5. Extended Address Data Page Interface To The MC68HC812A4
11.2.7.5 Subtraction Circuits
11.2.7.6 Instrumentation Amp (AD620)


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. We will be using an automated system to check for software plagiarism. 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 people's 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.
 

Request samples (DIP or PDIP package) You will need register with an official University email address (e.g., YourName@mail.utexas.edu) rather than a junk email address (e.g., aol.com or gmail.com) for
http://www.analog.com/en/index.html
Analog Devices

1) AD8032ANZ  rail-to-rail op amp


http://www.maxim-ic.com/
1) MAX1247ACPE+ 12-bit ADC, such as the  (A or B, with or without +)
2) MAX6225ACPA+  2.500V analog reference (with or without +) (ACPA or BCPA)
3) MAX539ACPA 12-bit SPI interface DAC (with or without +) (ACPA or BCPA)
 

http://www.ti.com 
1) OPA2350PA rail-to-rail dual op amp (with or without A)
2) TLC2272ACP rail-to-rail dual op amp (with or without A)
3) TLC2274ACN rail-to-rail quad op amp (with or without A)


Places to buy prototyping boards and other parts
In Austin

AlTex Electronics 832-9131
Frys Electronics 733-7000
Howard Electronics 837-2525

Mail Order

BG Micro, Dallas http://www.bgmicro.com/         Freescale http://www.freescale.com/
All Electronics, Los Angeles http://www.allelectronics.com/   Technological Arts http://www.technologicalarts.com
Digikey http://www.digikey.com/   Maxim http://www.maxim-ic.com/
Mouser Electronics www.mouser.com   Fairchild http://www.fairchildsemi.com/
Jameco, Belmont CA http://www.jameco.com/   Texas Instruments http://www.ti.com/

Curious about my research? See
http://users.ece.utexas.edu/~valvano/research