Texas Instruments MSP430x1xx User Manual

Page 156

Advertising
background image

Timer Modes

10-16

Figure 10–20. Capture Cycle

Second

Capture

Taken

COV = 1

Capture

Taken

No

Capture

Taken

Read

Taken

Capture

Clear Bit COV

in Register CCTL

Idle

Idle

Capture

Capture Read and No Capture

Capture

Capture Read

Capture

Overflow bit COVx is reset by the software as described in the following
example:

; Software example for the handling of captured data
; looking for overflow condition
;
; The data of the capture/compare register CCRx are taken
; by the software and immediately with the next
; instruction the overflow bit is tested and a decision is
; made to proceed regularly or with an error handler
;
CCRx_Int_hand

...

; Start of handler Interrupt

...
...

MOV

&CCRx,RAM_Buffer

BIT

#COV,&CCTLx

JNZ

Overflow_Hand

...
...
...

RETI

Overflow_Hand

BIC

#COV,&CCTLx

; reset capture
; overflow flag
; get back to lost
; synchronization

...
...

;

RETI

Note:

Capture With Timer Halted

The capture should be disabled when the timer is halted. The sequence to
follow is: stop the capture, then stop the timer. When the capture function is
restarted, the sequence should be: start the capture, then start the timer.

Advertising