|
UPD784938 Datasheet, PDF (300/733 Pages) NEC – 16-Bit Single-Chip Microcontrollers | |||
|
◁ |
CHAPTER 10 TIMER/EVENT COUNTER 1
Figure 10-28. Pulse Width Measurement Setting Procedure
Pulse width measurement
Set PRM1
Set CRC1
CRC1 â 04H
Set INTM0
Set MK0L
; Specify both edges as INTP0
input valid edges, release
interrupt masking
Initialize capture value buffer memory
X0 â 0
Start count
CE1 â 1
; Set 1 in bit 3 of TMC1
Enable interrupts
INTP0 interrupt
Figure 10-29. Interrupt Request Servicing that Calculates Pulse Width
INTP0 interrupt
Calculate pulse width
Yn = CR11 â Xn
Store capture value in memory
Xn+1 â CR11
RETI
300
Preliminary Userâs Manual U13987EJ1V0UM00
|
▷ |