46
MOTOROLA
6.7.5
Period measurement mode (mode 5)
The following program illustrates the usage of the timer module for input period measure-
ment. The period is measured in this example between 0 to 1 transitions of the input signal
on TIO0 and is stored in a table (in multiples of the chip operating clock divided by 2).
org x:$100
; define buffer in X memory internal
period
ds
$100
; measure up to 256 pulses
temp
ds
$1
; temporary storage
org p:$14
; this is timer0 interrupt vector address
jsr measure
; long interrupt to measure period
....
org p:main_body
.....
move #0,x:temp
; clear temporary storage
move #period,r0
; r0 points to start of table
move #$ff,m0
; modulo 100 to wrap around on end of table
movep #$54000000,x:TCSR0
; enable timer interrupts, mode5
bset #26,x:IPR
; enable IPL for timer 1
andi #$cf,mr
; remove interrupt masking in status register
bset #31,x:TCSR0
; timer enable
......
; do other tasks
.....
measure
movep x:TCR0,d0.l
; read new counter value
move x:temp,d1.l
; retrieve former read value (initially zero)
sub d1.l,d0.l
d0.l,x:temp
; compute delta (i.e. new -old) and store the
; new read value in temp
move d0.l,x:(r0)+
; store period value in table
rti
Summary of Contents for DSP96002
Page 3: ...1 2 DSP96002 USER S MANUAL MOTOROLA ...
Page 38: ...MOTOROLA DSP96002 USER S MANUAL 3 15 Figure 3 4 Modulo Arithmetic Unit Block Diagram ...
Page 39: ...3 16 DSP96002 USER S MANUAL MOTOROLA ...
Page 53: ...4 14 DSP96002 USER S MANUAL MOTOROLA ...
Page 76: ...MOTOROLA DSP96002 USER S MANUAL 5 23 Figure 5 8 Address Modifier Summary ...
Page 86: ...6 10 DSP96002 USER S MANUAL MOTOROLA ...
Page 101: ...MOTOROLA DSP96002 USER S MANUAL 7 15 Figure 7 9 HI Block Diagram One Port ...
Page 140: ...7 54 DSP96002 USER S MANUAL MOTOROLA ...
Page 166: ...9 10 DSP96002 USER S MANUAL MOTOROLA ...
Page 181: ...MOTOROLA DSP96002 USER S MANUAL 10 15 Figure 10 8 Program Address Bus FIFO ...
Page 337: ...MOTOROLA DSP96002 USER S MANUAL A 149 ...
Page 404: ...A 216 DSP96002 USER S MANUAL MOTOROLA PC xxxx D ...
Page 460: ...A 272 DSP96002 USER S MANUAL MOTOROLA SIOP Not affected ...
Page 484: ...A 296 DSP96002 USER S MANUAL MOTOROLA SSH PC SSL SR SP 1 SP ...
Page 519: ...MOTOROLA DSP96002 USER S MANUAL A 331 ...
Page 718: ...MOTOROLA DSP96002 USER S MANUAL B 199 ...
Page 871: ... MOTOROLA INC 1994 MOTOROLA TECHNICAL DATA SEMICONDUCTOR M Addendum ...
Page 888: ...MOTOROLA INDEX 1 INDEX ...
Page 889: ......