No announcements


[C|H]335 will explore how programs written in a high level language are evaluated by a processor to control the physical world. This fall we will be using an entirely new laboratory based upon the STM32 (ARM Cortex-M3) processor and utilizing off-the-shelf modules -- these and many other modules are readily available from on-line suppliers. We will use "C" to write programs to control these modules including an LCD display, a serial interface, a Wii Nunchuk, and an audio amplifier. In the process we will touch topics covered in a number of subsequent CS classes including compilers, operating systems, computer architecture, and digital design. It's obvious that we will be skimming the surface of these topics; for example, we will examine what a compiler and its associated tools (assembler, linker) do in some detail, but not how they are implemented to perform their function. My goal is that at the end of this course every student will be able to explain, in a technically accurate manner, the path from program to I/0 and will be proficient in using one representative set of tools to write programs to control a defined physical world. The progression of experiments introduces embedded system programming, programmed I/O, common protocols including async serial, SPI, and I2C; A/D based sensors, interrupts, and DMA.


c212, and corequisite C241; or consent of instructor.


Geoffrey Brown (Professor)
Office Hours: TBD
Office address: Lindley Hall 330H
Indiana University, Bloomington IN, 47405 USA
Office phone: 812-855-4207
Department fax: 812-855-4829

Gavin Whelan (UI)
Office Hours (Lindley 035) Monday : 2:30-4:00

Chris Zakian (UI)
Office Hours (Lindley 035) Monday 1:00-2:30

Ross Larson (UI)
Office Hours (Lindley 035) : Tuesday 5:30-7:00 and by appointment 1-2:15,
Wednesday: 5:30-7:00, Thursday: by appointment 1-2:15


You will need a good book on C programming

  • The classic is Kernighan and Ritchie, The C Programming Language, Upper Saddle River, NJ: Prentice Hall PTR, 2nd edition (1988).
  • However, this one is terser but will be a longer-lived reference (includes C99): Samuel P. Harbison, III, and Guy L. Steele, Jr. C, A Reference Manual, Fifth Edition, Upper Saddle River, NJ: Prentice Hall, Fifth Edition (2002).

Lab Manual (subject to frequent revision)

Lab Manual

Cortex-M3 Reference Materials

Definitive guide to the Cortex-M3 -- available online for IU students
Cortex-M3 Programming Manual
Cortex-M3 Technical Reference Manual
ARMv7-M Architecture Reference
ARM Procedure Call Standard
ARM and THUMB-2 Instruction Reference Card

Thumb-2 Supplement -- instruction encoding

STM32 Reference Materials

STM32F100x Reference Manual
STM32F100x Data Sheet

Value Line Discovery Reference Materials

Value Line Discovery User Manual
VL Discovery Pinouts (excel)

25LC160 Data Sheet

Helpful Compiler/Assembler Reference Materials

GNU Gcc intro
GNU AS intro

Code Sourcery Manuals

gcc manual
cpp manual
gas manual
ld manual
binutils manual
gdb manual
Newlib libc manual
Newlib libm manual
gdb reference card


There will be a required 3 hour laboratory session each week. Lab attendance is required and will be considered in your grade. You will work in teams of two students (determined by your lab instructor). After each assignment, you may adopt the code base of any other team for your next assignment, but you must cite their work. We will organize a formal way of tracking such code adoptions to give credit to those whose work influences the greatest number of other teams.

Each assignment is expected to take one week. You should use the laboratory session to start the assignment and to seek clarification from the AI. A report for the assignment will be due by midnight the night before your next laboratory session. You will also be given an oral evaluation by the AI. You must write your own report. You should turn in a paper copy of your report to your AI in lab. Electronic copies of your report and code should be submitted through github (see links below). You must cite any work you adapt from others.


Monday, Wednesday MW 9:05-9:55 Room WH 121

Attendance at lectures is required. The laboratory and lectures are tightly integrated. Attendance will be taken and considered in your grade.


In conversations I have had with various employers I've learned that they value teamwork skills highly.

A good partner is one who is accessible for meetings, comes prepared, and participates fully in the process. I've known "strong" students who are lousy partners and "weak" students who are excellent partners.

You may work with anybody in the class for homework, but you must make clear who you work with. Furthermore, you are responsible for turning in your own homework.

You are responsible for writing your own laboratory report -- joint reports are not permitted. I will make sure that the exams test your understanding of both the homework and the labs.


Grades are calculated as follows:

  • Labs 40%
  • Midterm 15%
  • Final 25%
  • Homework 20%


Anyone missing more than 3 classes will receive 1/3 grade reduction (e.g. A- to B+) for each class missed after the 3rd.

Quizzes and Exams

There will be one 50-minute midterm test, and a two-hour final exam. Many questions are subjective (written paragraphs, code).

  • Midterm: Wednesday October 10 (in class)
  • Final: Monday December 10 8am-10am

Excused Absences

Late assignments will be accepted only under the conditions similar to what could justify an Incomplete. All grades become final one week after the material is returned to you. If there is a foreseeable medical, personal, or professional reason requiring you to miss a lab or a test, notify us in advance and get written agreement from the instructor.


You will be given regular assignments -- each problem may have a different due date. You are responsible for checking the course web page for assignments. Your homework problems must be submitted in class on the due date. You will not be allowed to submit homework for others and you will not be allowed late homework except for documented absences due to illness, family emergency, or other university sanctioned reasons. Your homework should be submitted through your C335-Submissions github repository (see below under links).

Academic Integrity

Read the Computer Science Department's Statement on Academic Integrity to be sure you understand the rules under which computer science courses operate.


The last day to drop a course with an automatic W is Wednesday, October 17. After that date, a student may withdraw only with the permission of the Dean. This approval is normally given only for urgent reasons related to extended illness or equivalent distress.

Incomplete Grade

An Incomplete (I) final grade will be given only by prior arrangement in exceptional circumstances conforming to university and departmental policy, in which there has been some emergency late in the semester that interferes with your successful completion of the course and course work has been completed in passing fashion until the emergency.