Home | | | Research | | | Publications | | | | | Developed Courses | | | Seminar | | | Sponsors | | | Links | | | News | | | Contact Us |
Secure Computation LaboratoryProfessor Marten van Dijk |
Home | | | Research | | | Publications | | | | | Developed Courses | | | Seminar | | | Sponsors | | | Links | | | News | | | Contact Us |
Instructor: Marten van Dijk | TA: Syed Kamran Haider |
The basis of sophisticated designs of modern digital systems that appear in products such as automobiles, appliances and industrial tools is the Micro Controller Unit (MCU); a microcomputer optimized for single-chip system design for controlling peripheral devices geared to real-time applications. We will use the Atmega328P microcontroller (from the Atmel MEGA series RISC microcontrollers) in a series of labs to design microcontroller based systems. In particular, we will explain how to read and use the Atmega328P datasheet and how to write self-explanatory C code for interfacing with the MCU and controlling peripheral devices. This includes initializing register values, writing Interrupt Service Routines (ISRs), constructing underlying Finite State Machines (FSMs), and using a task based programming approach based on hardware timers.
Throughout the course students will learn the basics of C (without advanced data structures that involve pointers) and learn how to use C to program a Micro Controller Unit (MCU). This class aims to educate engineering students with little coding background. I.e., as a prerequisite students are expected to have some experience with basic structures such as loops, if-else statements, arrays, etc. (e.g., as used in MATLAB).
This class offers an intermediary course which allows students to prepare themselves for MCU courses which expect students to have real experience with C, e.g., Bruce Land’s course at Cornell. Our goal is to use the new ECE 3431 class as a prerequisite to a to-be-developed advanced MCU applications lab where we will teach the topics including real time OS, networking protocols such as CAN bus and ZigBee, OLED displays, motor control applications and much more.
The class as presented here is the first offering of its kind at UConn: Previous offerings only intended to show students that peripherals can be manipulated/controlled by a MCU, however, Interrupt Service Routines (ISRs) and timers took the backseat and a more advanced understanding of how to program in C was not taught. The class as presented here, which does explain proper task-based programming with ISRs, has been fully developed by Marten van Dijk and Syed Kamran Haider:
The links below provide the student view of all the taught material.
If you are a colleague faculty member, you can email at vandijk@engr.uconn.edu in order to get access to all the pptx, latex, and C source files together with all the solutions (which are omitted from the student view).
However, there is one catch: you need to acknowledge this course by adding (where appropriate) the following footnote to your slide decks:
Before coming to the first lecture/lab:
Week | Date | Lecture | Lab | Textbook Reading Assignment |
---|---|---|---|---|
1 | 31 Aug | Lec1a: Course Outline + Introduction to C-Programming | Lab1a: Examples basic C-Programming | |
2 Sep | Lec1b: Microcontroller introduction + General Purpose Digital Output (GPDO) | Lab1b: Examples basic C-Programming Continued |
Ch1. Ch2. till page 21 Ch2. 3 Ch2. 4 |
|
2 | 7 Sep | Labor Day – no classes | Labor Day – no classes | |
9 Sep | QUIZ 1: C-Programming | TEST 1: Basic C-Programming using Eclipse |
Your Fail/Pass the first QUIZ and TEST is a good indicator for being able to successfully complete this course!
From now on:
Week | Date | Lecture | Lab | Textbook Reading Assignment |
---|---|---|---|---|
3 | 14 Sep |
Class Question Lec2a: Universal Asynchronous Receiver & Transmitter (UART) |
Lab2a: AVR Board Setup (soldering) + LEDs (GPDO) | Ch. 5 till page 97 |
16 Sep |
Class Question Lec2b: General Purpose Digital Input (GPDI) + LCD Display |
Lab2b: UART (recognizing strings) Related Files: uart.h, uart.c |
Ch2. 6 | |
4 | 21 Sep |
Class Question Lec2c: Interrupt Service Routine (ISR) |
Lab2c: LCD + General Purpose Digital Input (GPDI) Related Files: lcd_lib.h, lcd_lib.c |
|
23 Sep | QUIZ 2: GPDO, GPDI, LEDs, UART, LCD | TEST 2: GPDO, GPDI, LEDs, UART (no LCD) |
Week | Date | Lecture | Lab | Textbook Reading Assignment |
---|---|---|---|---|
5 | 28 Sep |
Class Question Lec3a: ISRs + Timer 0 + Task based programming |
Lab3a: Non-blocking UART + debounced switches (uses ISR) | Ch. 9 |
30 Sep |
Class Question Lec3b: Timers 0, 1, and 2 |
Lab3b: Non-blocking LCD | ||
6 | 5 Oct |
Class Question Lec3c: External Interrupt + Pin Interrupt |
Lab3c: Non-blocking LCD continued | Ch. 8 |
7 Oct | QUIZ 3: Main focus: ISRs, Timers, nonblocking UART and LCD, External and Pin Interrupts | TEST 3: Main focus: ISRs, Timers, nonblocking UART and LCD, External and Pin Interrupts |
Week | Date | Lecture | Lab | Textbook Reading Assignment |
---|---|---|---|---|
7 | 12 Oct |
Class Question Lec4a: External Interrupt + Task based programming |
Lab4a: Human reaction time + Capture Interrupt Timer 1 | |
14 Oct | Lec4b: Review Session | Lab4b: Stopwatch | ||
8 | 19 Oct |
Class Question Lec4c: Pulse Width Modulation (PWM) |
Lab4c: Stopwatch continued | Ch. 10 |
21 Oct | QUIZ 4: Main focus: External Interrupt, PWM, Timers | TEST 4: Main focus: External Interrupt, PWM, Timers |
We will provide a prediction of your final score based on the average of your last three quiz/lab test scores.
From now on:
Week | Date | Lecture | Lab | Textbook Reading Assignment |
---|---|---|---|---|
9 | 26 Oct |
Class Question Lec5a: Analog-to-Digital Conversion (ADC) |
Lab5a: PWM | Ch. 7 |
28 Oct |
Class Question Lec5b: Analog-to-Digital Conversion (ADC) |
Lab5b: ADC | Ch. 12 | |
10 | 2 Nov |
Class Question Lec5c: EEPROM + Watchdog Timer |
Lab5c: Debugging using Atmel Studio Related Files: lab5c_files.zip |
Ch. 18: p. 387-396 Ch. 19 Ch. 20 |
4 Nov | QUIZ 5: Main focus: PWM, ADC, EEPROM, Watchdog, Debugging | TEST 5: Main focus: PWM, ADC |
Week | Date | Lecture | Lab | Textbook Reading Assignment |
---|---|---|---|---|
11 | 9 Nov |
Class Question Lec6a: Task based programming revisited + Real Time Operating System (RTOS) global understanding |
Lab6a: EEPROM + Watchdog + Assembly | |
11 Nov | Lec6b: Real Time Operating System (RTOS) task (process) scheduling |
Lab6b: Context switching and scheduling of tasks Related Files: kernel.h |
||
12 | 16 Nov | Lec6c: Real Time Operating System (RTOS) Interactive Process Communication (IPC) | Lab6c: Serial Peripheral Interface (SPI) | Ch. 16 |
18 Nov | QUIZ 6: Part of the quiz will be about RTOS | TEST 6: Part of the lab test is about scheduling and IPC in RTOS (no SPI) |
Week | Date | Lecture | Lab | Textbook Reading Assignment |
---|---|---|---|---|
23 Nov | Thanksgiving Recess – no classes | Thanksgiving Recess – no classes | ||
25 Nov | Thanksgiving Recess – no classes | Thanksgiving Recess – no classes | ||
13 | 30 Nov |
Class Question Lec7a: Advanced Topics |
Lab7a: SPI + Digital to Analogue Conversion (DAC) | |
2 Dec | Lec7b: Advanced Topics | Lab7b: Two Wire Interface (TWI/I2C) | Ch. 17 | |
14 | 7 Dec | QUIZ 7: Main focus: SPI, I2C, DAC, Advanced Topics | TEST 7: Main focus: SPI, DAC, RTOS (no I2C) |
All material will be tested during a 115 minutes closed book final:
Week | Date | Lecture | Lab | Textbook Reading Assignment |
---|---|---|---|---|
14 | 9 Dec | Wrap-Up; Q&A | Wrap-Up; Q&A | |
15 | 14-18 Dec | Finals Week | Finals Week |