+ All Categories
Home > Documents > ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.

ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.

Date post: 12-Jan-2016
Category:
Upload: hilary-turner
View: 217 times
Download: 0 times
Share this document with a friend
Popular Tags:
21
ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes
Transcript
Page 1: ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.

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.

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.

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.

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.

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.

ECE447: MSP430 Timer I/O Pins and Channels - 4618

Page 7: ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.

ECE447: MSP430 Compare/Capture Block Diagram.

Page 8: ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.

MSP430xx4xx Implementation of Timer_A

Page 9: ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.

Timer_A Interrupt Schematic

Page 10: ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.

Timer_A MSP430xx4xx Registers

Page 11: ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.

TACTL: Timer_A Control Register

Page 12: ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.

TAR: Timer_A Register

Page 13: ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.

TACCRx: Timer_A Capture/Compare Register

Page 14: ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.

TACCTLx: Capture/Compare Control Register

Page 15: ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.

TAIV: Timer_A Interrupt Vector Register

Page 16: ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.

ECE447: MPS430 Timer_A input clocks and dividers

Page 17: ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.

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.

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.

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.

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.

ECE 447: Measuring intervals >216 clock cycles

start

stop0

FFFF

1 2 3

R2

R1

N=4

R1+R2=R


Recommended