CHAPTER 9 TIMER/COUNTER FUNCTION (REAL-TIME PULSE UNIT)
User’s Manual U12688EJ4V0UM00
276
Figure 9-14. Example of Pulse Width Measurement Setting Procedure
Initial pulse width
measurement setting
Setting the TMC11 register
;
Specifies the count clock
Initializing buffer memory
for capture data storage
X0
←
0
Count start
TMC11.CE11
←
1
Enabling interrupt
Setting the INTM2 register
INTM2.ES121
←
1
INTM2.ES120
←
1
Setting the TUM11 register
TUM11.CMS112
←
0
;
Specifies both edges of the INTP112
input signal as active edges
;
Sets it as the capture register
;
Sets the CE11 bit (1)
INTP112 interrupt
Figure 9-15. Example of Interrupt Request Processing Routine Which Calculates the Pulse Width
INTP112 interrupt processing
(both the rising and falling edges)
Calculating the pulse width
Yn = CC112 – X
n–1
tn = Yn
×
count clock period
;
Xn, Yn: Variables
; tn: Pulse width
Storing of nth time capture data
in buffer memory
Xn
←
CC112
RETI
Caution If 2 or more overflows occur between the (n – 1)th capture and the nth capture, the pulse
width cannot be measured.
Содержание V850E/MS1 UPD703100
Страница 2: ...User s Manual U12688EJ4V0UM00 2 MEMO ...
Страница 6: ...User s Manual U12688EJ4V0UM00 6 MEMO ...
Страница 8: ...User s Manual U12688EJ4V0UM00 8 MEMO ...
Страница 12: ...User s Manual U12688EJ4V0UM00 12 MEMO ...
Страница 26: ...User s Manual U12688EJ4V0UM00 26 MEMO ...
Страница 68: ...User s Manual U12688EJ4V0UM00 68 MEMO ...
Страница 124: ...User s Manual U12688EJ4V0UM00 124 MEMO ...
Страница 198: ...User s Manual U12688EJ4V0UM00 198 MEMO ...
Страница 230: ...User s Manual U12688EJ4V0UM00 230 MEMO ...
Страница 422: ...User s Manual U12688EJ4V0UM00 422 MEMO ...