UPD784026 Renesas Electronics Corporation., UPD784026 Datasheet - Page 271

no-image

UPD784026

Manufacturer Part Number
UPD784026
Description
16/8-bit Single-chip Microcontrollers
Manufacturer
Renesas Electronics Corporation.
Datasheet
(9) Although the timer register can be read, if counting up the timer and reading the timer register conflict, the read value of
the timer register may be illegal. Therefore, do not read the timer register if at all possible.
If it is necessary to read the timer register, read it two or more times in a row in software, and assume the value of the timer
register is correct only when all the read values match.
(a) Processing on starting counting
(b) Processing on reading count value
Figure 8-54 To Distinguish Whether One or No Valid Edge Has Been Input with External Event Counter
Read TM0 contents
Count value
read
AX
AX
AX = 0?
End
AX+1
TM0
NO
Clear INTP3
interrupt request flag
CHAPTER 8 TIMER/COUNTER 0
YES
Start count
Assign the number of input valid edges to AX register
Start count
PIF3
CE3
YES
End
0
1
PIF3 = 1?
NO
; Clear PIF3 to 0
; Set CE3 to 1
;
;
Check TM0 value.
If 0, check interrupt
request flag.
Check PIF3 contents.
If 1, valid edge is input.
231

Related parts for UPD784026