ECE 340/341 Microcontrollers and Lab (Fall 2015)
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:
978-0-7506-8709-6. Author's web site Text Errata
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 24 - LD1 and MX3. (Review LD2-3 as needed)
- Aug 31 - FRM12 and PLIB10. (I/O)
- Sep 7 - LD4 and 7, FRM6 (Clocking)
- Sep 14 - LD2 (timer section), FRM14, PLIB11. (Timers)
- Sep 21 - FRM8, FRM12.4, PLIB7, and LD5. (Interrupts)
- Sep 28 - FRM13, PLIB17, LD6 (string portion), and LD10. (PMP)
- Oct 5 - Digilent LCD PMOD
- Oct 12 - FRM21, PLIB16, LD9. (RS232)
- Oct 19 - FRM24, PLIB15, LD8. (I2C)
- Nov 2 - FRM16, PLIB13, LD16. (Output Compare/PWM)
- Nov 16 - FRM15, PLIB12, LD12 (particularly pp. 290-291) (Input Capture)
Homework and Quizzes (20%)
There will be homework and quizzes, possibly
unannounced, throughout the semester. These will be used to ensure that
are keeping up with the reading, the lectures, and the lab. In
addition, a prelab will be required via e-mail submission by 8 am on the first Tuesday of each lab, starting with Lab 1.
- Sep 09. HW1
- Sep 16. HW2
- Sep 28.
Oct 12. HW4. In addition
- 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?
- Write an equation for the rate
at which the T1IF flag will be set as a function of the peripheral bus
clock frequency, the prescale value, and the period register.
an equation for the required step delay as a function of the desired
speed, the mode, and the number of steps per revolution for a given
21. Puzzler of the Day - Is a square wave a valid RS232 signal? If so,
what "information" is transmitted (be specific) and how would you test
26. Clearly explain how a C program running on the PIC32 can recognize
that it has reached the end of a physical page in the EEPROM while
performing multi-byte writes, as shown in Figure 6-2 of the datasheet.Nov
11. Jim wants a PWM carrier frequency of 500 Hz. (a) If Timer 2 is
clocked by the peripheral bus clock with a prescale of 1, what should
he load into the period register and what is his resolution in bits?
(b) What value should he load into OC3R if he wants the initial duty
cycle to be 45%? (c) What changes if he instead uses a prescale value
of two for the timer clock and leaves everything else the same? Please show all work to receive full credit. (as always!) :-)
do we need a handshake between the PMP and the LCD controller, whereas
we don't use handshakes when accdssing PIC32 peripherals, such as
Timer 1 (or the PMP)?
- Briefly describe two different methods of controlling the LCD from the PIC32
- Identify in detail the steps required to move the cursor to the middle of the second line, without changing the LCD display
Each exam is worth 100 points and will be closed book, closed notes.
Semester exams are 50 minutes long; the final exam
two hours long and comprehensive. Please bring paper, calculator,
and eraser to the exam.
- Sep 18. Topic List
- Oct 16. Topic List
- Nov 16. Topics List
Final Exam. Tues, Dec 15, 10 am - noon.
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.).