CSCE 236: Embedded Systems
Spring 2016

Instructor

Dr. Carrick Detweiler
Computer Science and Engineering
220 Schorr Center
carrick _at_ cse.unl.edu
Office Hours:
Tuesday 9:30-10:30am: Carrick in 220 Schorr
schedule online, and by appointment.

Teaching Assistant

Graduate TA: Najeeb Najeeb
Undergraduate TA: Zack Boone
Undergraduate TA: Dylan Fromm
Undergraduate TA: Manuel Garcia
Undergraduate TA: Jonathan Lee
Undergraduate TA: Firhard Roslan

Office Hours:
Monday 1:00-2:00pm: Dylan in SRC
Monday 2:00-3:00pm: Najeeb in SRC
Tuesday 9:30-10:30am: Carrick in 220 Schorr
Tuesday 10:30-11:30am: Firhard in SRC
Tuesday 12:30-1:30pm: Jon in Schorr Lobby
Wednesday 12:30-1:30pm: Manuel in Schorr Lobby
Wednesday 1:30-2:30pm: Zach in SRC
Wednesday 2:00-3:00: Najeeb in SRC

Course Information

Lecture: Tuesday and Thursday 8:00-9:15am in Avery 110

For detailed information on this course please see the course syllabus in html or pdf format.

Course Description

Embedded Systems are everywhere. Every time you look at your watch, answer the phone, take a picture, or turn on the TV you are interacting with an embedded system. Embedded systems are also found in cars, airplanes, and robots. They far outnumber traditional computers (which also contain embedded processors) and learning to design and program embedded systems is a critical skill that is necessary for many industry and scientific jobs.

In this course you will learn the basics of designing, interfacing, configuring, and programming embedded systems. We will make use of the Arduino platform, which is an inexpensive, popular embedded system used by hobbyists, researchers, and in industry, to implement the techniques learned in class. By the end of the course you will have mastered the basics of embedded system design and programming. This course will help to prepare you for cutting edge careers in industry and research.

Datasheets and other useful documents

Assignments

See the course schedule below for reading assignments and the general topics covered in the course. Unless otherwise noted, assignments are due at the start of class on the due date.

Assignment Due Date
Course Survey Weds, Jan 13th, 5pm
HW 1 (pdf,code) Start of class, Thurs, Jan 21
HW 2 (pdf) Start of class, Tues, Feb 2nd
Lab 1 (pdf,html) Thurs, Jan 28th in class
HW 3 (pdf,code) Start of class, Thurs, Feb 11th
Lab 2 (pdf,html,lab2_button_count.ino) Thurs, Feb 11th in class
Test1 from prior years: 2012, 2013, 2014, 2015 For review
HW 4 (pdf,code) Start of class, Thurs, March 3rd
Lab 3 (pdf,html) Thurs, Feb 11th in class
Project 1 (pdf)
Robot Building Instructions (pdf)
Checkpoint, Thursday, March 10 (in class)
Competition, Thursday, March 17 (Schorr 2nd floor, 8:00-10:00)
Written report, Thursday, March 31 start of class
Top Times
HW 5 (pdf) Start of class, Tues, April 12th
Project 2 (pdf)
Project 2 Bracket
Wall Checkpoint, Thursday, April 14, 2016 (in class)
Obstacle Checkpoint, Tuesday, April 19, 2016 (in class)
Competition, Tuesday and Thursday, April 26 & 28, 2016
Report, Video, and Surveys, Friday, April 29, 2016 at noon
Lab 4 (pdf,html*,blink irq)
VCNL4000 Ranger Info:
Sparkfun, Datasheet, Application Note, Sample Code
Thursday, April 7
Test2 from prior years: 2012, 2013, 2014, 2015 For review
For assignments that require electronic code submission, you can do so at: https://cse-apps.unl.edu/handin.
*Note html versions of assignments may lack some formatting or pictures found in the pdf version.

Course Books

Marilyn Wolf, Computers as Components, Third Edition: Principles of Embedded Computing System Design, 3nd ed. Morgan Kaufmann, 2012
Available in the book store or purchase online. Readings from this book are specified in the format Wx.x, where x.x indicates the chapter and subsection.

David Russell, Introduction to Embedded Systems, 2010.
Available for free download when on the UNL campus. Good reference for embedded C programming. Do not print out this book, it is less expensive to order a printed copy than to print it yourself. Readings from this book are specified in the format Rx.x, where x.x indicates the chapter and subsection. Note: this book is specifically designed for the Arduino platform, but there are some differences between the version of the Arduino used in the book and the version we are using in class. So be careful!

Edward Lee and Sanjit Seshia, Introduction to Embedded Systems, A Cyber-Physical Systems Approach, 2011.
Available for free download. Do not print out this book, it is less expensive to order a printed copy than to print it yourself. There are no specific readings from this book, but it is a good reference for those interested in exploring some subjects further.

Brian W. Kernighan and Dennis M. Ritchie, C Programming Language (2nd Edition), 1988. ISBN: 0131103628
Learn C The Hard Way, Zed Shaw
A wiki-style C "text book" alternative
Another online C text book
C Frequently Asked Questions from the days of Usenet
Suggested references for those with little prior C programming experience. There are no specific readings from these, but they are good references (thanks to Dr. Bourke for some of these references).

Course Schedule

Below is an approximate schedule of course topics. These are subject to change, assignments will be announced in class. Readings are recommended and will be added as the semester progresses, so make sure to check back often; however, the best resource for this course is attending class and taking good notes. The course is roughly broken into regular class lectures on Monday and Wednesday and then lab-style lectures on Fridays where a Labture is specified. Typically during labtures there will be a short topic-specific lecture followed by a hands-on, small group, in class lab assignment.

Week Class Topics Labture Reading
Week 1, Jan 11 course intro, c programming R2.1, R2.2, R2.4
Week 1 Additional Readings: Basic C Types
More on Basic C Types
Bit Operations
More Bit Operations
Fixed width types
Why use uint8_t
C Pre-Processor and Macros
How not to write code and the output (really, try compling it)
Pointers
Function Pointers
Apollo Guidance Computer
Week 2, Jan 18 (NO CLASS Monday) embedded system design, arduino intro, basic circuit diagrams R2.5, R2.6, R2.7, R2.8, W1.1, W1.2
Week 3, Jan 25 instruction sets, registers and mem access, digital I/O Arduinos W2.1, W2.2, R6.*
Week 2 and 3 Additional Readings: Basic circuit elements
How to read a schematic
Arduino Uno R3 schematic
How to read a datasheet
Atmega328 datasheet
Register-based digital I/O
Another register-based digital I/O (just make sure to use bit operations (|=,&=) and not binary value!)
Arduino-function digital I/O
AVR memory map overview (see datasheet as well)
Directly accessing memory/registers with C macros (but for ARM, not AVR)
Directly accessing memory in assembly
Program counter (general info)
AVR program counter
Reading the program counter (not straight forward, but sometimes useful)
Week 4, Feb 1 registers and memory, debugging W3.1, R7.*
Week 5, Feb 8 debugging, timers timers and I/O R4.*
Week 4 and 5 Additional Readings: Suggestions for debugging ES
More debugging suggestions
JTAG
Another JTAG link
Yet another JTAG link
Viewing assembly output
Arduino build process overview
General info on timers
AVR timers
Week 6, Feb 15 timers and review test 1(tentative)
Week 7, Feb 22 timers, PWM, and analog to digital converters (A2D) PWM and servos R8.*
Week 6 and 7 Additional Readings: Read section 16 in the datasheet on the Timer/Counter1 with PWM
Details of Arduino millis fuction (and how it uses Timer0)
Sparkfun PWM
Arduino PWM (including analogWrite)
Wikipedia PWM
Fast versus Phase/Freq Correct PWM
How servos work
More on how servos work
Wikipedia ADC
Sparkfun ADC
More ADC
Week 8, Feb 29 CPU bus, communication protocols (UART, SPI, RS485) A2D W4.1, R10.1 to R10.1.3
Week 9, March 7 project
Week 8 and 9 Additional Readings: Parallel versus Serial, UART (sparkfun)
Serial and Parallel Comms (a bit of history too)
Serial Communication (Wikipedia)
Parallel Communication (Wikipedia)
Serial Comms, UART, RS232, RS485
UART (Wikipedia)
UART (sparkfun)
More UART (but beware, code examples for a different processor)
Interfacing a UART to USB-UART converter (TTL, RS232, USB, etc)
SPI (sparkfun)
SPI (wikipedia)
SPI (arduino)
Week 10, March 14 project 1 competition
NO CLASS SPRING BREAK
Week 11, March 28 interrupts interrupts, communication W3.1.4, W3.2, R9.*
Week 12, April 4 I2C, peripherals, sensors i2c R10.1.2
Week 11 and 12 Additional Readings: Interrupts
More Interrupts
Even More Interrupts
Interrupts, very broadly (wikipedia)
List of all interrupts on AVR
AVR Libc Interrupt Reference
AVR pitfalls of reentrant code
I2C (warning code examples not for Arduino)
I2C (sparkfun)
I2C (wikipedia)
I2C aka Wire Library (arduino)
Week 13, April 11 Embedded Operating Systems, review project checkpoint W6.1, W6.2, W6.3
Week 14, April 18 power management, embedded algorithms, program optimization project checkpoint, test 2(tentative) W5.5, W5.6, W5.7
Week 15, April 25 final project competition final project competition