NET3001-F09 Course Page

Carleton logo

Instructor

Times and Locations

Course Outline

Course Notes

Assignments

Grading, Midterm & Exams

Resources (new page)

Change list

Instructor:

Pat Beirne (patb@sce.carleton.ca)

Office hours:

Tuesdays & Thursdays from 1pm until 2pm and by appointment, AP230A

Class Times & Locations

  • Lectures Tuesdays and Thursdays at 11:30 until 13:00 from Sept 10th to Dec 3rd inclusive

  • Labs Tuesday from 14:00 (2pm) until 17:00 (5pm), Sept 15th to Dec. 1st inclusive

Course Description & Outline

Real-time systems are designed to interact with their environment in a time-critical manner. NET3001 provides an introduction to the fundamental principles of these systems. It also presents different issues associated with using a single processor computer system to implement a real-time system. The objectives of this course are to:

  • introduce the development of real-time embedded systems

  • introduce hardware interrupts as the sources of asynchronous events

  • introduce the concept of concurrency in a single processor computer system using the event, message and dispatcher model

  • provide practical laboratory exercises that reinforce an event-driven perspective in the development of embedded real-time systems

The course will provide practical experience in low-level programming in an embedded platform. A special programming system has been developed for this course, containing the TI MPS430 microcontroller and a host of specialized input/output devices and interfaces.

The development will be done on the Eclipse IDE platform, using both Assembly Language and C. The student will learn to program on both a device simulator and an actual device hosted by the MTS Project Board.

Roughly, the course breaks down into: one quarter assembly language, one quarter C coding, one quarter interrupt coding and one quarter event-driven event-driven programming. The concepts that will be covered are applicable to a wide range of computer systems, programming languages, and applications.


There is no specific textbook required for this course. However, several PDF files can be found in the Resources section below.

Lab Equipment   

Each student will be given a NET3001 MTS board for use during the term. The student can bring the MTS board home; I expect the student to take reasonable care of the board assigned to him/her.

The MTS board will be used for all assignments and labs.

Each student will be required to leave a $150 security deposit on receipt of the MTS board. This deposit will be returned on Dec 3rd upon returning the MTS board to the lab personnel. [Boards which are returned in a non-functional state will have a repair fee deducted from the security deposit.]

MTS board

Lecture schedule (tentative)

1

Sept 10

Course objectives, organization and administration; Lab information. Introduction : What is an embedded system? What is a real time system? Microprocessors vs. Microcontrollers. Programmer’s Model of the MSP430: Instruction Set, Memory, I/O. Notes

2

Sept 15

Introduction to the Eclipse IDE. Programming the MSP430 assembly language. Instruction Set: format, addressing modes. Basic operations: data transfer,. Notes

Lab 1: Review of C coding techniques. Installing Eclipse on your laptop.

3

Sept 17

Arithmetic, overflow, assembler program definition Directives. Basic operations (cont.): multiple-byte operations (carry condition register). Assembly code in Eclipse. Notes and more notes

4

Sept 22

Control flow: conditions, jumps. Basic operations: shift and Boolean logic operations. Notes

Lab2: learning the tools, sample solution

5

Sept 24

Program execution time. Hardware and software development tools. Symbol Table. Assembly 2-Pass Process, Linking, Cross-Assembly, Simulation, Execution, Debugging.

Array manipulation. Strings. Structures. Notes

6

Sept 29

The stack. Introduction to subroutines. Subroutine definition policies. The stack frame. Notes

Lab3: loops, arrays, strings, subroutines, sample solution

7

Oct 1

Parameter passing: by value, by reference.

Introduction to ANSI C language programming using the GNU C compiler. Notes

8

Oct 6

Basic concepts of Input/Output. Overview of the MSP430 parallel ports

Interfacing with simple Input/Output devices: LEDs. Notes

Lab4: delays, subroutines, first I/O, sample solution

9

Oct 8

Intro to C. Notes

10

Oct 13

C startup code. Variables. Stepper motor. DC motor.

Lab5: basic I/O, timers, motors, PWM (in C) sample solution

11

Oct 15

Timer Functions. Real-time interrupt. Timer counter register. Pulse width modulation. Notes

Interrupts: fundamental concepts. Reset vector.

12

Oct 20

MIDTERM and a sample solution

Lab6: stepper, libraries, first interrupts with timer & keyboard; required files sample solution

13

Oct 22

Interrupt Programming in C. Notes and more notes

14

Oct 27

Lab7: interrupts, timers, LCD sample solution

15

Oct 29

Interrupts. Motors. Interrupt sample code; interrupt coding style.

16

Nov 3

Libraries. Message and event based programming. Notes

State machines; some demo code and its state diagram

Lab8: interrupts

17

Nov 5

State machines. Timers: notes and more notes

More state machines. The cooperative multitasking framework: dispatcher.

18

Nov 10

More state machines.

Lab9: multitasking framework

19

Nov 12

Crosswalk demo


20

Nov 17

Discussion of interrupt programming issues: randomness of interrupt occurrence,  timing diagrams (notes)

Lab10: Using the radio library

21

Nov 19

ADC coding. Preemtive multitasking.

22

Nov 24

Flashlight demo code and helper

Process Model Introduction to real-time kernels. Multithreaded Preemptive Scheduler (Round-robin). (notes)

Lab 11: free time for project work (assignment 6)

23

Nov 26

TBD


24

Dec 1

This lecture is reserved for slippage and misc. topics that may arise during the term. Real-Time Programming Issues: Reentrant Programming. Concurrency, critical sections, shared variables, mutual exclusion. Buffering : FIFO, FIFO Dynamics, Double Buffering The Serial Subsystems. Asynchronous Serial I/O, SCI.

Lab 12: Short coding exercises

25

Dec 3

Review and wrap up



Course Notes

Intro

NET3001-1-Intro.pdf

Assembly language

NET3001-2-Asm.pdf
NET3001-2b-HowFast.pdf
NET3001-4-AdvAsm.pdf

C coding

NET3001-5-C.pdf

Interrupts

NET3001-6-Interrupts.pdf

I/O

NET3001-7-IO.pdf
NET3001-7a-IO.pdf

Timers

NET3001-8-RTI.pdf
NET3001-8-Timers.pdf

Multitasking

NET3001-9-CooperativeMultitasking.pdf
NET3001-9a-StateMachine.pdf

Misc

NET3001-10-MiscTopics.pdf
NET3001-10a-MiscTopics.pdf
NET3001-10b-MiscTopics.pdf
NET3001-11-ADC.pdf





Assignments

Assignment Deadlines

Assignment 1. Sept 17, 9pm here is a solution

Assignment 2. Oct 1 

Assignment 3. Oct 15  Updated! there was a typo on page 3, ACD10SR has been changed to ADC10SR; due date changed to Oct 16/noon. Solution posted here

Assignment 4. Oct 29 Modified on Oct 16; minor changes A solution is here

Assignment 5. Nov 19

Assignment 6. Dec 3

All assignments will be handed in electronically by running this program. Here are instructions for using the program. Late assignments will recieve a mark of 0.

Resources

Web Site

Course materials will be placed on the NET3001 Web site, so students are expected to have Internet access. The URL for the NET 3001 website is http://www.csit.carleton.ca/~pbeirne/NET3001/Outline.html

Laboratory and Assignments:

The term work is made up of six graded assignments. Assignments will be posted here on the course web page. Each assignment must be handed in on (or before) the due date and time. Late assignments will not be accepted without a valid medical certificate. Students are encouraged to discuss design issues when working on assignments; however, they are expected to write their own programs individually. There is a fine line between cooperating with your colleagues (discussing problems and ideas) and copying program code (plagiarism). Some assignments may require reuse of code from earlier assignments, so be sure to get all of the assignments working, and keep an extra copy when submitting assignments.

Students are warned that the assignments form a very important part of this course – doing the assignments is by far the best way of learning the material. In this context, it should be noted that copying assignments is a self-defeating exercise. Primarily, you won't learn the course material; any student who resorts to copying is not likely to do well on the mid-term or final exam. And secondly, the person marking the assignments uses a sophisticated pattern match tool to locate student copying.



Grading Scheme:

To pass the course, a student must pass the final examination (D- or better) and obtain an overall passing average (assignments plus midterm plus final exam). Students who miss an assignment or midterm must present a valid medical certificate to the instructor within a reasonable time after the deadline or midterm; otherwise, the student will receive a zero for that item. For students who pass the final exam, the final grade will be calculated as follows:

    Assignments: 18%

    Mid-term test: 25%

    Final exam: 57%

Exams & Midterms:

There is one midterm in this course.

There will be one closed book, no calculators, mid-term test. It will be administered in class on October 22.

A closed book, no calculators, final exam will be held during the University's formal examination period. The final exam is for evaluation purposes only and will not be returned to the students.

Students who miss the final exam may be granted permission to write a deferred examination (see the Undergraduate Calendar for regulations on deferred exams). These students have additional months to study and a less crowded examination schedule compared to their colleagues who write the final exam in December. As such, it is only fair to expect substantially better performance from these students on the deferred examination than on the final exam.

Students with Disabilities:

Students with disabilities requiring academic accommodations in this course are encouraged to contact the Paul Menton Centre for Students with Disabilities (500 University Centre) to complete the necessary forms. After registering with the Centre, make an appointment to meet with me in order to discuss your needs at least two weeks before the first in-class test. This will allow for sufficient time to process your request. Please check with the Paul Menton Centre for the deadline for submitting completed forms for formally scheduled exam accommodations.

Plagiarism:

Plagiarism (copying and handing in for credit someone else's work) is a serious instructional offense that will not be tolerated. Please refer to the section on instructional offenses in the Undergraduate Calendar for additional information.

Changes

Sept 5, 2009
changed the dates for the lectures; I thought school started Sept 8th, but it turns out it starts on the 10th, so everything had to shift
Sept 17 Assignment 1 delayed until 9pm. Assignment 2 will be up by 5pm
Sept 22
I incorrectly labelled the "add with carry" instruction as ADC; this is wrong, it should be ADDC. Slide set 1is affected; it's been corrected.
Oct 2
Assignment 3 had a typo; it's fixed
Oct 13
Moved the midterm to Oct 20; changed assignment 3 slightly (initialize with ADC10SHT_3 instead of  ADC10SHT_2)
Oct 14
Assignment 3 due date changed to Oct 16, noon
Oct 16
Minor changes to Assignment 4 (nothing big, just added some beeps in part 2)
Oct 18
Study notes added; see assignment 3, lab 4 and lab 5 solutions; midterm at 11:30 on Tuesday Oct 20.
Oct 22
Midterm solution posted here
Oct 28
Assignment 4 clarification: during the calibration phase, you use the 1 & 2 key to move the stepper; you may finish calibration with either the '3' key or the '*' key, your choice.

Assignment 4 deadline changed to 9am, Nov 2.

Exam will take place on Friday Dec 11, 2pm, in the classroom.
Nov 5
Assignment 4 solution, posted in cooperative multitasking style, posted here