Below is a preview of our week-by-week plan for the entire quarter. There may be slight adjustments and rearrangements as we go. The schedule for the final project is set and will not change.
In the readings below, K&R refers to Kernighan and Ritchie's classic text The C Programming Language (accessible via Stanford's subscription to Safari Books Online). Nick Parlante's EssentialC is another great C reference. Please do the recommended readings before lecture for best effect!
| Week 1 | ||
| Lecture Mon 1/5 |
Welcome and intro to RISC-V
( slides, code )
After a quick recap of course logistics, we dive right in to RISC-V and the Mango Pi MQ-Pro SBC we will be using this quarter. Readings:
|
|
| Lab/assign |
Lab 0: Orientation
( writeup )
Please do the Lab 0 prelab preparation before coming to lab. |
Assignment 0: Git oriented ( writeup ) |
| Lecture Fri 1/9 |
RISC-V assembly and machine code
( slides, code )
RISC-V ISA and assembly language. Arithmetic and logical operations, load and store instructions. Control flow using branch/jump. Readings:
|
|
| Week 2 | ||
| Lecture Mon 1/12 |
From Assembly to C
( slides, code )
Moving up from assembly to C. Implementation of C expressions and control structures. Readings:
|
|
| Lab/assign |
Lab 1: Getting to know your Mango Pi
( writeup )
Please do the Lab 1 prelab preparation before coming to lab. |
Assignment 1: Larson Scanner ( writeup ) |
| Lecture Fri 1/16 |
C Pointers and Arrays
( slides, code )
Memory, addresses, and pointers. Address arithmetic, memory layout of arrays and structures. Readings:
|
|
| Week 3 | ||
| Lecture Mon 1/19 |
MLK Day (no lecture) | |
| Lab/assign |
Lab 2: Below C Level
( writeup )
Prelab to prep before lab. |
Assignment 2: Clock ( writeup ) |
| Lecture Fri 1/23 |
C Functions
( slides, code )
Implementation of function control flow, call, return. Parameter passing. Coordination on use of registers. Runtime stack management. Readings:
|
|
| Week 4 | ||
| Lecture Mon 1/26 |
Communication and the Serial Protocol
( slides, code )
Using gpio lines to transmit bits, UART peripheral, Ascii character set, C-strings. Readings:
|
|
| Lab/assign |
Lab 3: Debugging and Testing
( writeup )
Prelab to prep before lab. |
Assignment 3: String Formatting ( writeup ) |
| Lecture Fri 1/30 |
Modules, Libraries, and Linking
( slides, code )
Build process, makefiles, linking, libraries, module design Readings:
|
|
| Week 5 | ||
| Lecture Mon 2/2 |
Memory Management
( slides, code )
Stack frames, backtrace, dynamic allocation, implementing a heap allocator Readings:
|
|
| Lab/assign |
Lab 4: Linked and Loaded
( writeup )
Prelab to prep before lab. |
Assignment 4: Stack and Heap ( writeup ) |
| Lecture Fri 2/6 |
C Mastery
( slides, code )
We've crossed the halfway point! We will use this lecture to catch-up/expand on lecture content covered lightly on first pass, and discuss how to further your mastery of C. Readings:
|
|
| Week 6 | ||
| Lecture Mon 2/9 |
Keyboards and the PS/2 Protocol
( slides, code )
Prof. Chris Gregg will lead a lecture on all things keyboard: the venerable P2S/2 protocol plus bonus excursions into Midi protocol and controlling an old-school typewriter! Readings:
|
|
| Lab/assign |
Lab 5: Keyboard Surfin'
( writeup )
Prelab to prep before lab. |
Assignment 5: Keyboard and Simple Shell ( writeup ) |
| Lecture Fri 2/13 |
Graphics and the framebuffer
( slides, code )
Representing color, framebuffer memory, drawing, fonts Readings:
|
|
| Week 7 | ||
| Lecture Mon 2/16 |
Presidents Day (no lecture) | |
| Lab/assign |
Lab 6: Drawing into the Framebuffer
( writeup )
Prelab to prep before lab. |
Assignment 6: Graphics Library and Console ( writeup ) |
| Lecture Fri 2/20 |
Interrupts
( slides, code )
In this first lecture on interrupts, we'll focus on the low-level mechanics and what needs to happen at the assembly level to enable and process an interrupt. Readings: |
|
| Week 8 | ||
| Lecture Mon 2/23 |
Interrupts, cont'd
( slides, code )
Now we move up to the higher-level abstractions for interrupts, including library support for managing interrupt handlers and best practices for interrupt-safe code. Readings:
|
|
| Lab/assign |
Lab 7: Mango Pi, Interrupted
( writeup )
Prelab to prep before lab. |
Assignment 7: System Monitor with Interrupts ( writeup ) |
| Lecture Fri 2/27 |
Project
( )
Our awesome team will offer guidance and inspiration on how to achieve a satisfying and successful final project!
|
|
| Week 9 | ||
| Lecture Mon 3/2 |
Sensor Input
( slides, code )
Reading gpio inputs, how electrical signals can be used to observe physical phenomena, analog to digital conversion, protocols I2C and SPI. Readings:
|
|
| Lab/assign |
Lab 8: Project Team Meeting 1
( writeup )
|
Final Project ( writeup ) |
| Lecture Fri 3/6 |
Output
( slides, code )
Controlling gpio outputs, digital-to-analog conversion, pulse-width modulation (PWM), I2S protocol for digital sound input/output. Readings:
|
|
| Week 10 | ||
| Lecture Mon 3/9 |
Wrap or There and Back Again
( slides, code )
Looking back to where we started, celebrating a great quarter of learning, making, and engineering together, previewing what comes next. Bring your questions and share your feedback on the course. Readings:
|
|
| Lab/assign |
Lab 9: Project Team Meeting 2
( writeup )
|
|
| Lecture Fri 3/13 |
No lecture, work on projects! | |
| Week 11 | ||
| Final Project Demo session Fri 3/20 at 9:00 am Code submission due Fri 3/20 at 11:59 pm |
||