ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.
-
Upload
hilary-turner -
Category
Documents
-
view
218 -
download
0
Transcript of ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.
![Page 1: ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.](https://reader035.fdocuments.us/reader035/viewer/2022062322/56649ea75503460f94ba9845/html5/thumbnails/1.jpg)
ECE 447 Fall 2009
Lecture 10: TI MSP430
Timers and Capture Modes
![Page 2: ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.](https://reader035.fdocuments.us/reader035/viewer/2022062322/56649ea75503460f94ba9845/html5/thumbnails/2.jpg)
Timer_A Overview
• Timer Block– The core, based on 16-bit register TAR– Can chose sources for clock and freq division– Timer block has no output– Flag TAIFG is raised when counter returns to 0
• Capture/compare channels– Capture an input, record value in TAR triggered by TACCRn– Compare TAR with the value stored in TACCRn– Request an Interrupt by setting its flag TACCRn CCFIG– Sample an input at a compare event
![Page 3: ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.](https://reader035.fdocuments.us/reader035/viewer/2022062322/56649ea75503460f94ba9845/html5/thumbnails/3.jpg)
ECE 447: MSP430 Timer_A System
1. Generating delays - imposing a specific delay between two points in the program by polling.
label 1
label2
instr1instr2
instrN
delay
![Page 4: ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.](https://reader035.fdocuments.us/reader035/viewer/2022062322/56649ea75503460f94ba9845/html5/thumbnails/4.jpg)
ECE 447: MSP430 Timer_A System
2. Input capture - measuring the time between signal edges
3. Output compare - generating signals with the given timing characteristics
start stop
start stop
pulse width
single pulse periodical signal
period
![Page 5: ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.](https://reader035.fdocuments.us/reader035/viewer/2022062322/56649ea75503460f94ba9845/html5/thumbnails/5.jpg)
ECE 447: MSP430 Timer_A System
4. Real Time Clock– Produce a periodic signal for the MSP430.
period
The Real Time Clock Interrupt implements a hardware based time of day clock that can be used by the software.
![Page 6: ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.](https://reader035.fdocuments.us/reader035/viewer/2022062322/56649ea75503460f94ba9845/html5/thumbnails/6.jpg)
ECE447: MSP430 Timer I/O Pins and Channels - 4618
![Page 7: ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.](https://reader035.fdocuments.us/reader035/viewer/2022062322/56649ea75503460f94ba9845/html5/thumbnails/7.jpg)
ECE447: MSP430 Compare/Capture Block Diagram.
![Page 8: ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.](https://reader035.fdocuments.us/reader035/viewer/2022062322/56649ea75503460f94ba9845/html5/thumbnails/8.jpg)
MSP430xx4xx Implementation of Timer_A
![Page 9: ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.](https://reader035.fdocuments.us/reader035/viewer/2022062322/56649ea75503460f94ba9845/html5/thumbnails/9.jpg)
Timer_A Interrupt Schematic
![Page 10: ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.](https://reader035.fdocuments.us/reader035/viewer/2022062322/56649ea75503460f94ba9845/html5/thumbnails/10.jpg)
Timer_A MSP430xx4xx Registers
![Page 11: ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.](https://reader035.fdocuments.us/reader035/viewer/2022062322/56649ea75503460f94ba9845/html5/thumbnails/11.jpg)
TACTL: Timer_A Control Register
![Page 12: ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.](https://reader035.fdocuments.us/reader035/viewer/2022062322/56649ea75503460f94ba9845/html5/thumbnails/12.jpg)
TAR: Timer_A Register
![Page 13: ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.](https://reader035.fdocuments.us/reader035/viewer/2022062322/56649ea75503460f94ba9845/html5/thumbnails/13.jpg)
TACCRx: Timer_A Capture/Compare Register
![Page 14: ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.](https://reader035.fdocuments.us/reader035/viewer/2022062322/56649ea75503460f94ba9845/html5/thumbnails/14.jpg)
TACCTLx: Capture/Compare Control Register
![Page 15: ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.](https://reader035.fdocuments.us/reader035/viewer/2022062322/56649ea75503460f94ba9845/html5/thumbnails/15.jpg)
TAIV: Timer_A Interrupt Vector Register
![Page 16: ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.](https://reader035.fdocuments.us/reader035/viewer/2022062322/56649ea75503460f94ba9845/html5/thumbnails/16.jpg)
ECE447: MPS430 Timer_A input clocks and dividers
![Page 17: ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.](https://reader035.fdocuments.us/reader035/viewer/2022062322/56649ea75503460f94ba9845/html5/thumbnails/17.jpg)
ECE447: Measuring Pulse Widths
Timer overflows
100 s < width < Configured Period (previous table)
width 100 s
width Configured Period (previous table)
start stop
start stop
start stop
![Page 18: ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.](https://reader035.fdocuments.us/reader035/viewer/2022062322/56649ea75503460f94ba9845/html5/thumbnails/18.jpg)
ECE 447: Measuring intervals <216 clock cycles
start
0
FFFF
stop
![Page 19: ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.](https://reader035.fdocuments.us/reader035/viewer/2022062322/56649ea75503460f94ba9845/html5/thumbnails/19.jpg)
ECE 447: Measuring intervals <216
clock cycles (overflow)
start
0
FFFF
1 2
stop
![Page 20: ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.](https://reader035.fdocuments.us/reader035/viewer/2022062322/56649ea75503460f94ba9845/html5/thumbnails/20.jpg)
ECE 447: Measuring intervals >216 clock cycles
start
stop
0
FFFF
1 2 N=3
R
![Page 21: ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.](https://reader035.fdocuments.us/reader035/viewer/2022062322/56649ea75503460f94ba9845/html5/thumbnails/21.jpg)
ECE 447: Measuring intervals >216 clock cycles
start
stop0
FFFF
1 2 3
R2
R1
N=4
R1+R2=R