ECE 340/341 Microcontrollers and Lab (Fall 2014)
All assignments are collected at the start of class
on the specified due date. Each assignment should have your name, the course
number, the date, and the assignment designation (e.g., HW1, etc.). Attendance
is mandatory. Students who miss five or more class periods
will receive a final grade of F for the course. (Arriving late or leaving
early is considered absent.)
The primary goal of this course is to give you the fundamental skills needed
to understand, use, and design microcontroller-based systems. This includes
the following: (1) What is a microcontroller? (2) What can it do (and not
do)? (3) How does one design (and program) a microcontroller-based system?
Note: In addition to the listed prerequisites, ECE 340/341 required
junior-level standing in EE or CompE. (e.g., You must have passed both Digital
Logic and Circuits II with a C or better.)
Programming 32-bit Microcontrollers in C, Lucio Di Jasio, 2008. ISBN:
Please complete the reading assignments in a timely manner so that you may
contribute in the class discussions. The following abbreviations are used
below, with # identifying the chapter or section: LD - Day # from the class
text by Lucio Di Jasio; FRM - PIC32 Family Reference Manual (separate PDF
file per section); DS - PIC32MX Datasheet (single PDF file); PLIB - PIC32
Peripheral Library Guide; MX - MPLAB X User Guide ; and XC - XC32 Compiler
Aug 25 - LD1 and MX3. (Review LD2-3 as needed)
- Sep 1 - FRM12 and PLIB10
- Sep 8 - LD4 and 7, FRM6
- Sep 15 - LD2 (timer section), FRM14, PLIB11
- Sep 29 - FRM8, FRM12.4, PLIB7, and LD5
- Oct 3 - FRM13, PLIB17, LD6 (string portion), and LD10
- Oct 10 - Digilent LCD PMOD
- Oct 17 - FRM21, PLIB16, LD9
- Oct 24 - FRM24, PLIB15, LD8
- Oct 27 - I2C section of CerebotMX7ck Reference Manual and the Microchip EEPROM Datasheet
- Nov 3 - FRM16, PLIB13, LD16
- Nov 18 - FRM15, PLIB12, LD12 (particularly pp. 290-291)
Homework and Quizzes (20%)
There will be approximately 50 points worth of homework and quizzes, possibly
unannounced, throughout the semester. These will be used to ensure that students
are keeping up with the reading, the lectures, and the lab.
- Aug 29.
- Explain in a professional paragraph why you think EE majors are required to take ECE 340.
- In your own words, what is the difference between a high-level language like C and assembly language?
- How are the input/output pins of the PIC32 arranged?
Sep 17. HW3Sep
29. Assume Timer 1 is clocked by the peripheral bus clock (10 MHz) with a
prescale value of 256. (1) What value should be written to PR1 in order
to achieve a 1 ms delay? (2) If we use this configuration to delay for
100 ms, how much time will actually have elapsed?Oct
1. (a) Why can't an ISR accept arguments as inputs and return a
value? (b) What question(s) do you have regarding interrupts after
Jim's introduction?Nov 3. I2C homeworkDec
5. As discussed in class, a switched capacitor circuit can be used
instead of an R2R ladder for implementing an n-bit DAC. During the
"acquisition" period, a positive voltage is built across all of the
capacitors, equal to the analog input voltage, and then the free
terminals are driven to ground and the common terminal released,
driving the common terminal to -V_in. The charge on the capacitors
remains the same, as there is still a positive voltage bias across the
capacitors. Next, the free terminal of the capacitor representing the
MSB of the DAC is connected to V_ref. Question: What is the
resultant voltage on the common terminal? Explain your reasoning
with words and equations. (Understanding SAR ADCs)
- What are Special Function Registers (SFRs) and what purpose do they serve?
integers are 32-bits wide and can be represented by eight hexadecimal
digits (think ECE 240!!!). Which bit positions are set to a '1' in the
following 32-bit word: 0xC0301005?
- Progammers often use C
bitwise logical operators such as &, |, and ^, to manipulate which
bit positions are set to '1' (or to '0'!). This is often referred to as
"masking", where a constant is used to force certain values or protect
certain fields (i.e., groups of bits) within a word. Write the result
for each of the following equations, assuming x is set to the value
shown above: x & 0x01010101; x | 0x11001100; and x ^ ~x.
Each exam is worth 100 points and will be closed book, closed notes. Semester exams are 50 minutes long; the final exam will be
two hours long and comprehensive. Please bring paper, calculator, pencil(s)
and eraser to the exam.
Sep 19. Topics List
Oct 17. Topics List
Nov 14. Topics List
Final Exam. Mon, Dec 15, 10 am - noon. Topics List
Grades (and other information) will be distributed electronically to student
UI e-mail addresses periodically throughout the semester. Grades will be
calculated using the traditional scale (90%=A, 80%=B, etc.).