23.04.2013 Views

TMPM330 - Keil

TMPM330 - Keil

TMPM330 - Keil

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Prescaler output clock<br />

TB5IN0 pin input<br />

TB5IN1 pin input<br />

Taking data into TB5CP0<br />

Taking data into TB5CP1<br />

INTCAP50<br />

INTCAP51<br />

Under development<br />

Time Difference Measurement<br />

<strong>TMPM330</strong> (rev 0.4)8-33<br />

<strong>TMPM330</strong><br />

The up-counter (UC5) is made to count up by putting it in a free-running state using the<br />

prescaler output clock. The value of UC5 is taken into the capture register (TB5CP0)<br />

at the rising edge of the TB5IN0 pin input pulse. The NVIC must be programmed to<br />

generate INTCAP50 interrupt at this time.<br />

The value of UC5 is taken into the capture register TB5CP1 at the rising edge of the<br />

TB5IN1 pin input pulse. The NVIC must be programmed to generate INTCAP51<br />

interrupt at this time.<br />

The time difference can be calculated by multiplying the difference between TB5CP1<br />

and TB5CP0 by the clock cycle of an internal clock.<br />

C1<br />

Time difference<br />

C2<br />

Fig. 8-9 Time Difference Measurement<br />

16-bit Timer/<br />

Event Counters (TMRBs)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!