220 likes | 338 Views
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
E N D
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
ECE 447: MSP430 Timer_A System Generating delays - imposing a specific delay between two points in the program by polling. label 1 instr1 instr2 delay instrN label2
ECE 447: MSP430 Timer_A System 2. Input capture - measuring the time between signal edges start stop stop start 3. Output compare - generating signals with the given timing characteristics single pulse periodical signal pulse width period
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.
ECE447: Measuring Pulse Widths 100 s < width < Configured Period (previous table) stop start width 100 s stop start width Configured Period (previous table) stop start Timer overflows
ECE 447: Measuring intervals <216 clock cycles FFFF stop start 0
ECE 447: Measuring intervals <216 clock cycles (overflow) 1 2 FFFF start stop 0
ECE 447: Measuring intervals >216 clock cycles 1 2 N=3 FFFF stop R start 0
ECE 447: Measuring intervals >216 clock cycles 3 N=4 1 2 FFFF R1 start R1+R2=R stop 0 R2