6 December 2004
Revision History | |
---|---|
Revision 0.9 | 6 December 2004 |
Partial draft public distribution. |
This study guide is made up of questions relating to many of the main topics that will be covered in the Final. The Final includes all the material covered in the lectures and all of the labs.
The study guide is not exhaustive (i.e. not all topics you are responsible for are covered.)
You cannot assume that Final questions will bear any resemblance to the questions in this Study Guide. Memorizing canned answers is not a good idea; use the questions/answers to help identify areas you need to bone up on.
You should attempt to answer the questions before peeking at the answers. If you cannot understand an answer after reviewing the core material, ask you prof for help.
The questions should be considered as “closed book”—i.e. you should be able to answer them without reference to a text book or data sheet. However, some of the questions do require technical details that you are not expected to have memorized. (For example, what is the machine language translation of ldaa #3 or which bit is used to tell the A/D subsystem to perform continuous conversions?) For these cases, a Reference Material section is included.
Although the Final covers the entire course, this Study Guide concentrates on the topics not covered in the Quiz and Midterm Study Guides. You should also review those guides in preparation for the Final.
This material contains technical details that may be required to answer certain questions.
The bits in the Control/Status register (ADCTL, mapped to address 0x1030) are:
The interpretation of the bits is:
0: conversion NOT complete; 1: conversion complete.
0: Convert 4 channels; 1: Convert single channel.
0: continuous conversion; 1: one-shot conversion.
Channel number (0-7).
This 16-bit free-running counter is incremented by the E clock. When the count overflows from 0xffff to 0x0000, the timer overflow flag bit (TOF) is set in TFLG2. An interrupt can be enabled by setting the interrupt enable bit in TMSK2.
The 3 16-bit input capture registers TIC1, TIC2 and TIC3 (mapped to 0x1010/0x1011, 0x1012/0x1013 and 0x1014/0x1015) latch TCNT's value on a defined transition of an input edge detector.
The 5 16-bit output compare registers TOC1, TOC2, TOC3, TOC4 and TOC5 (mapped to 0x1016/0x1017, 0x1018/0x1019, 0x101A/0x101B, 0x101C/0x101D and 0x101E/0x101F) set the OCxF (flag) bit when equal to TCNT.
When equality occurs, an interrupt may occur if enabled and/or an output action on a PORTA bit may occur as specified (in TCTL1 for TOC2—TOC5).
The bits are interpreted as follows:
Each 2-bit OMx/OLx pattern specifies an action:
OMx/OLx | Action |
---|---|
00 | Do nothing. |
01 | Toggle OCx output. |
10 | Clear OCx output. |
11 | Set OCx output. |
The bits are interpreted as follows:
Each 2-bit EDGxB/EDGxA pattern specifies an action:
EDGxB/EDGxA | Action |
---|---|
00 | Capture disabled. |
01 | Capture rising edges. |
10 | Capture falling edges. |
11 | Capture any edge. |
TMSK1 is used to enable interrupts on any of the 5 Output Compare (OC) or 3 Input Capture (IC) registers. The bits are interpreted as follows:
An OC/ICxI bit enables the corresponding interrupt when set.
TFLG1 is used to indicate events on any of the 5 OC or 3 IC registers. The bits are interpreted as follows:
An OCxF flag bit is set by hardware when TCNT equals the corresponding TOCx register.
An OCxF flag bit is cleared by software by writiing a ONE to the corresponding bit.
TMSK2 is used to enable interrupts on when a corresponding flag bit is set in TFLG2. The bits are interpreted as follows:
The interpretation of the bits is:
0/1: Disable/enable Timer Overflow Interrupt.
0/1: Disable/enable Real Time Interrupt.
0/1: Disable/enable Pulse Accumulator Overflow interrupt.
0/1: Disable/enable Pulse Accumulator Input interrupt.
TFLG1 is used to indicate timer events. The bits are interpreted as follows:
The interpretation of the bits is:
Set by hardware when TNCT advances from 0xFFFF to 0x0000.
Cleared by software when a ONE is written to the flag bit.
Set by hardware when rising edge on selected tap point.
Cleared by software when a ONE is written to the flag bit.
Set by hardware when the pulse accumulator rolls over from 0xFF to 0x00.
Cleared by software when a ONE is written to the flag bit.
Set by hardware when an active edge is detected on the PAI input pin.
Cleared by software when a ONE is written to the flag bit.