EE445M Embedded and Real-Time Systems Lab  (3/07/2014 version) Spring 2014
EE380L.6
 Real-time Operating Systems
Credit for both EE445M and EE380L.6 will not be allowed. Graduate students should register for EE380L.6 and undergraduates should register for EE445M.
Class
: ENS127, Monday, Wednesday, Friday 10-10:50am

Professor Office Hours (subject to change): Monday 11-12noon, Tuesday 11-12noon, Friday 1-2pm

Office hours Link

TAs:

Pohan Wu : pohan29 at gmail.com
Sparsh Singhai : sparshsinghai91 at gmail.com

Nagaraja Revanna: nagarajamails at gmail.com 

Instructor: Jonathan W. Valvano, ENS627, 471-5141
email valvano@mail.utexas.edu   (put "EE445M" or "EE380L" in the email title)
Web page http://users.ece.utexas.edu/~valvano 
Unique Numbers, Lab ENS252A:
16870 17185 TTh 12:30-2:00PM   xxx

16875 17190 TTh 2:00-3:30PM     xxx

16880 17195 TTh 3:30-5:00PM   xxx

16885 17200 MW 6:30-8:00PM   xxx

16890 17205 TTh 6:30-8:00PM   xxx
Text: Embedded Systems: Real-Time Operating Systems for ARM Cortex-M Microcontrollers, Volume 3, second edition, 2nd printing, January 2014, ISBN: 978-1466468863. Available on Amazon  Available on CreateSpace
Optional reference Text: MicroC/OS-III: The Real-time Kernel, Third Edition, Jean J. Labrosse. This is a nice book, but it cost $200 and includes a STM32 board (not our board, but similar). It covers general OS topics, explains the use of MicroC/OS-III and includes details of the M3.  There is also a second edition MicroC/OS-II that covers an earlier and simpler OS, without a board. The 3rd edition is nicely written but specific for the MicroC/OS-III.
 Email all TAs and professor sp14_ee445m@utlists.utexas.edu               

EE445L TAs:                 
Mahesh Srinivasan, email srinimahesh at utexas.edu

Victoria Bill, email victoriagbill at gmail.com

email zichonglig1 at gmail.com

 Lecture notes and lab manual http://users.ece.utexas.edu/~valvano/EE345M/ 
Development board: Student can choose whether to learn USB/CAN or Ethernet. Students who choose to learn USB/CAN will use the TI EK-TM4C123GXL  LaunchPad plus graphics display.  Students who choose to learn Ethernet will be using the TI Stellaris LM3S8962 development kit   Each group of two students will must buy/borrow one kit. However I strongly suggest each student purchase their own kit. The easiest way to buy the LaunchPad is from the TI estore at

        https://estore.ti.com/AddToCart_TI.aspx?p=EK-TM4C123GXL
or    http://octopart.com/ek-tm4c123gxl-texas+instruments-28491014

Since the LaunchPad does not have a display you will need to purchase one of these Sitronix ST7735R 18-bit color 1.8" TFT LCD display

    http://www.adafruit.com/products/358 

The LM3S8962 board is no longer being produced but there are some available for purchase. If you wish to learn Ethernet, then search octopart for availability

    http://octopart.com and search for EKK-LM3S8962

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 EE319K, EE445L EE445M and EE380L.6
    http://www.keil.com/uvision/ Information about the compiler/debugger system
We will use 32-k limited version of the Keil uVision4 see https://www.keil.com/demo/eval/armv4.htm   A large number of software examples for the LM3S8962 will be available by installing the StellarisWare(R).

Starter files: http://users.ece.utexas.edu/~valvano/arm/ Cortex M program files for EE319K, EE445L, and EE445M

Old Exams http://users.ece.utexas.edu/~valvano/EE345Moldquiz/ 
Other references: For programming in C, see the EE312 text, or C programming book

EE445L textbook: Embedded Systems: Real-Time Interfacing to ARM Cortex M Microcontrollers, 2013, ISBN: 978-1463590154

Course Catalog Description Embedded microcomputer systems; implementation of multitasking, synchronization, protection, and paging; operating systems for embedded microcomputers; design, optimization, evaluation, and simulation of digital and analog interfaces; real-time microcomputer software; and applications, including data acquisition and robotics.

Prerequisites: EE445L or EE445S and EE333T.  This class is the third in a sequence of three microcontroller laboratories. I expect you to have experiences with assembly language, serial ports (UART and SPI), periodic interrupts, ADCs, edge triggered interrupts, FIFO queues and C programming.  We will be using the ARM Cortex-M, and we expect the prior experiences for most students would have been with a different microcontroller. You are also expected to understand how the DFT is used to observe digitally sampled data in the frequency domain.

Teaching philosophy
I strongly encourage students to take an active role in this class.  There will be a copious amount of action in this class: debugging, soldering, screwing, cutting, and testing. Questions are welcome before, during and after class. Please feel free to email, visit or call me if you have questions.

Specific Objectives of EE445M/EE380L.6
The primary objective of EE445M/EE380L.6 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.
ARM architecture, and C programming
    Minimally intrusive debugging
    Performance measures
Synchronization methods
    Busy-wait, interrupt, DMA, periodic polling, priority interrupts
Embedded Communication Systems
    Serial network protocols, layered software, CAN, Ethernet, and USB
Real time operating systems
    Foreground and background thread scheduling
    Synchronization using spinlock and blocking semaphores
    Interthread communication
Digital Device Interfaces
    SD drive interface using SPI, file systems
    Diodes, transistors, DC motors, servos, stepper motors, relays, solenoids,
    Optical sensors, IR distance sensors and contact switch sensors
Time Domain Interfaces
    Input capture/output compare, frequency, period and pulse width measurements,
    Pulse-width modulation
Data Acquisition Systems
    Op amp amplifiers, analog low pass filters, ADC, FIFO queues, digital filters
Control systems
    Open loop and closed loop, Linear and Nonlinear,
    Bang-bang control, incremental control, PID Control
The purpose of EE445M/EE380L.6 is to provide students an in depth understanding of real-time operating systems, real-time debugging, and embedded systems. After the successful conclusion of EE445M/EE380L.6 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.

Attendance: Students are expected to attend all lectures, which are at 10 o'clock in the morning.  Fundamental material will be presented in class, and the details can be found in the book, the data sheets and the library files provided by the manufacturer. Some lecture material will be posted on the web, while other lecture material will only be presented in class.   If you decide that you do not want to come to every lecture, please drop this class. 

EE445M Grading: 40% Laboratory
    15% Quiz 1, closed book, Friday Feb 28, 10-10:50am, in ENS127
    15% Quiz 2, open book, open book, Friday April 4, 10-10:50am, in ENS127
    30% Final, part closed book part open book, Friday May 10, 2013, 2-5pm, regularly scheduled
Please notice the dates for the exams; there will be no re-tests, make-ups, or incompletes. Class attendance will be used for deciding grades in borderline cases. I don't usually use A- grades, but otherwise I plan to use +/- grading. I have no expected grade cutoffs or expected GPA for this class. You can view the previous GPA for classes at UT at www.MyEdu.com. This web site reports I give a GPA in EE445M of 3.4.  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. 

EE380L.6 Project: The graduate student will attend the lectures, take the exams, and perform the labs. In addition to all the regular EE445M assignments, the graduate student will design, build, debug, and document an extra lab project involving the design, implementation and testing of an embedded system with a real-time operating system. The complexity of this project should be equivalent to one of the regular labs. The project  should be approved in advance by the instructor. A 1/2 page written proposal concerning the project is due by the end of February. The project must be demonstrated to a TA by the last class day of the semester. Project report is due to the instructor the first Monday after classes are over. You are free to choose a project in your field of interest. It must include an embedded system and a real-time operating system of your design. You must write microcomputer software and/or build microcomputer hardware. It must actually be built and tested. The report will be typed double spaced. The minimum page count is 15 and the maximum page count is 20 (including hardware diagrams, but not software listings.) The grading policy for the report has four parts:
    25% English style, grammar, spelling, clarity of discussion, objectives
    25% Neatness, hardware diagrams, data flow graphs, call graphs
    25% Engineering quality, how well it works, creativity, correctness
    25% Evaluation and test procedures, how do you verify its correctness.
EE380L.6 Grading: 
    80% Regular EE445M grade
    20% Project 

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/EE380L 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.

EE445M/EE380L Laboratories
1a. Real-time clock, Sitronix ST7735R Display, ADC and graphics drivers on the TM4C123 board running on an ARM Cortex-M4 (review of EE445L)
1b. Real-time clock, oLED Display, ADC and serial port drivers on the LM3S8962 board running on an ARM Cortex-M3 (review of EE445L)
2. Real-time operating system kernel (thread switching and synchronization)
Part 1) is cooperative and preemptive schedule
Part 2) has periodic and switch interrupts, has spin-lock semaphores

3. Blocking semaphores, priority scheduling, performance measures, dumping RTOS profile data to the PC
4. Microphone input, digital filters, FFT, display spectrum on the display (LCD)
5. Solid state disk, SSI, address translation, layered software, file system
Formula 0001 Racing Robot  (teams of 3, 4 or 5)
6. Distributed data acquisition using a CAN network of IR distance sensor, Ping))) distance, wheel RPM   
7A. Moving and turning, PID control
7B. Sensor design and interfacing
7C.
Control algorithm, system performance analysis
 

Lab Schedule

Week

First session

Second session

Friday 10am

Comments

1/13

none

none

 

no lab activities

1/20

Meet the TA,

1 PrePrep, Select partners

 

Keil uVision4 demonstration

1/27

1 Prep

 

 

Spectrum analyzer demo

2/3

1 Demo 

2 Part 1) Prep

1 Report

 

2/11

 2 Part 1) Demo

2 part 2) Prep


 Part 1)  only has prep and demo (no report)

2/17

 

2 Part 2) Demo 

 

2 Part 2) Report

 

2/24

3 Prep

 

 

 

 Quiz 1 is 2/28

3/3

3 Demo 

4 Prep (bonus)

3 Report  (on line, 5pm)

4 Prep (on line, 5pm)

There is a hard deadline on Lab 3. If Lab 3 is not demonstrated by second session, revert to Lab 2 and complete rest of labs with Lab 2 OS.

3/17

4 Demo

5 Prep

4 Report

 

3/24

5 Demo 

6 Prep

5 Report

 

3/31


6 Demo 


Quiz 2 is 4/4

4/7

 6 Report

7A Prep

 

 

4/14

 

7A Demo

 

 

4/21

 

 

7B Demo

 

4/28

 

7C Demo

7C Report

Turn in equipment by 5/2

No lab 1/13-17

Prep = you turn in your lab preparation
Demo = you demonstrate your lab to the TA
Report = you turn in your complete lab report to the TA

Lecture Schedule (rough draft)  

Week

Book

Topic

1/13

1-3

Modular programming, call graphs, synchronization, data flow graphs, show differences between busy-wait and interrupt synchronization, uVision4 compiler, device drivers, quality software, friendly

1/20

1, 2.5, 2.6, 3.7

Arm architecture, instruction set, stack, interrupt servicing, lab environment, debugging techniques, intrusiveness, monitor, output to scope, simulator, periodic interrupts

1/27

3.4, 3.5, 4.1, 4.2, 4.3

RTOS,  threads, TCB switching, spinlock semaphores, draw initial TCB, performance measures (response time, throughput), use of the FIFO, and thread communication,

2/3

4.2, 4.3, 4.4, 4.5, 4.7.2, 3.7

Blocking semaphores,  add cooperative multitasking priority scheduling, debugging, monitors, path expression

2/10

3.6, 3.7, 2.12, 5.1, 5.2

Critical sections, debugging of the RTOS, time jitter, microphone interface, rail-to-rail single supply circuits, ADC

2/17

5.3, 5.3, 5.4, 5.5, 5.6

Analog filters, Digital filers, FFT, graphics

2/24

5.6, 6.1, 6.2, 6.3, 6.6

DFT, windowing, SD interface using SSI,  DMA

F 2/28

 

Quiz 1 in regular classroom, covering material in Labs 1, 2, 3

3/3

6.4, 7

DMA, File system

3/17

9.2, 3.4, 3.1

Controller area network, FIFO queue, layered software

3/24

8

Transistor interfaces (TIP120, L293, IRF540), motor interfacing, Pulse width modulation,  Input capture, simple period measurement,

3/31

10.1, 10.2, 10.3

Control systems, PID control systems

F 4/4

 

Quiz 2 in ENS115,  covering material in Labs 1, 2, 3, 4, 5

4/7

10.4, 4.6

Fuzzy logic, Fixed rate scheduler

4/14

 9.3

Ethernet, MicroC/OS-II, Vxworks, effect of sampling jitter,

4/21

 

Team work, testing and the design process

M 4/28

 

course review and evaluation

W 4/30

 

Robot preliminary competitions 3rd floor ENS

F 5/2

 

Robot final competitions 3rd floor ENS

F 5/2

 

all Lab notebooks are due to the TA  

F 5/2

 

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

5/xx

 

Final exam, xxx, 2-5pm, Time/place regularly scheduled

 

 

 

     No lab activities occur during the week of January 13.  During the week of January 20-23, please go to your scheduled lab sessions in ENS252A to get a demonstration of the lab equipment.  Lab partners will be selected in your lab the week of January 20-23.  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 chip numbers (be very specific e.g., OPA2350PA). 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.

Legal Stuff: The 12th class day is January 29. The drop policy is extremely complicated. See your academic advisor or the Dean of Students for more information. 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. Students with disabilities may request appropriate academic accommodations from the Division of Diversity and Community Engagement, For more information, contact Services for Students with Disabilities, 471-6259, http://www.utexas.edu/diversity/ddce/ssd/. April 1 is the last day an undergraduate student may, with the dean’s approval, withdraw from the University or drop a class except for urgent and substantiated, nonacademic reasons.

Religious Holy Days By UT Austin policy, you must notify me of your pending absence at least fourteen days prior to the date of observance of a religious holy day. If you must miss a class, an examination, a work assignment, or a project in order to observe a religious holy day, I will give you an opportunity to complete the missed work within a reasonable time after the absence. 

Scholastic dishonesty: "Faculty in the ECE Department are committed to detecting and responding to all instances of scholastic dishonesty and will pursue cases of scholastic dishonesty in accordance with university policy. Scholastic dishonesty, in all its forms, is a blight on our entire academic community. All parties in our community -- faculty, staff, and students -- are responsible for creating an environment that educates outstanding engineers, and this goal entails excellence in technical skills, self-giving citizenry, an ethical integrity. Industry wants engineers who are competent and fully trustworthy, and both qualities must be developed day by day throughout an entire lifetime. Scholastic dishonesty includes, but is not limited to, cheating, plagiarism, collusion, falsifying academic records, or any act designed to give an unfair academic advantage to the student. The fact that you are in this class as an engineering student is testament to your abilities. Penalties for scholastic dishonesty are severe and can include, but are not limited to, a written reprimand, a zero on the assignment/exam, re-taking the exam in question, an F in the course, or expulsion from the University. Don't jeopardize your career by an act of scholastic dishonesty. Details about academic integrity and what constitutes scholastic dishonesty can be found at the website for the UT Dean of Students Office and the General Information Catalog, Section 11-802." 
You are encouraged to study together and to discuss information and concepts with other students. You can give "consulting" help to or receive "consulting" help from such students in oral form. However, this permissible cooperation should never involve one student having possession of a copy of all or part of work done by someone else, in the form of an email, an email attachment file, a portable storage device, or a hard copy. Copying of any part of a program is cheating without explicit reference to its source. We do enter lab assignments turned in by other students through a plagiarism checker, comparing them to assignments of this and previous semesters. 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. It is appropriate to use software out of the book, class website as long as all copy-pasted software is explicitly referenced. Copy-pasting software from current or past students is scholastic dishonesty. 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 the web.
        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.

The University Honor Code is "The core values of the University of Texas at Austin are learning, discovery, freedom, leadership, individual opportunity, and responsibility. Each member of the University is expected to uphold these values through integrity, honesty, trust, fairness, and respect toward peers and community."  http://registrar.utexas.edu/catalogs/gi09-10/ch01/

Many manufacturers will send free samples to students. I suggest you order free samples of some op amps and shunt reference for Spring 2014. Devices come in many sizes and shapes. So, when requesting samples be sure to specify the package you want: big surface mount, tiny surface mount, or DIP. In this lab you will need DIP 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)

Analog Devices http://www.analog.com/en/index.html   AD8032ANZ  rail-to-rail dual op amp

Maxim http://www.maxim-ic.com/  MAX494CPD rail-to-rail quad op amp  (any plastic DIP,  with or without +)

Texas Instruments http://www.ti.com  TLC2274ACN rail-to-rail quad op amp, and  LM4041CILPR adjustable shunt reference


Other cool chips, but not needed

MAX1247ACPE+ 12-bit ADC, such as the  (A or B, with or without +)

MAX492CPA rail-to-rail dual op amp  (any plastic DIP, with or without +)

MAX494CPD rail-to-rail quad op amp  (any plastic DIP,  with or without +)

MAX539ACPA single 12-bit SPI interface DAC (ACPA or BCPA)

MAX6225ACPA+  2.500V analog reference (with or without +) (ACPA or BCPA)

MAX5154ACPE dual 12-bit SPI interface DAC (ACPE or BCPE)

TLC2272ACP rail-to-rail dual op amp

INA122P rail-to-rail instrumentation amp

OPA2350PA rail-to-rail dual op amp

SamTec http://www.samtec.com/   Click Samples, register

Samtec SD-115-G-2 (could use two for LM3S8962 Board)

Samtec SD-110-G-2 (could use two for LM3S2110 Board)

Samtec ESW-110-37-L-D (could use two for each LM4C123 LaunchPad)


Places to buy prototyping boards and other parts
In Austin
AlTex Electronics 832-9131
Frys Electronics 733-7000
Radio Shack multiple


Full service sales
Digikey, http://www.digikey.com/
Mouser Electronics, www.mouser.com
Newark, www.newark.com
Sparkfun, www.sparkfun.com   
Jameco, http://www.jameco.com/
Arrow, http://parts.arrow.com/

Surplus sales
BG Micro, http://www.bgmicro.com/
All Electronics, http://www.allelectronics.com/

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