UPD784026 Renesas Electronics Corporation., UPD784026 Datasheet - Page 307

no-image

UPD784026

Manufacturer Part Number
UPD784026
Description
16/8-bit Single-chip Microcontrollers
Manufacturer
Renesas Electronics Corporation.
Datasheet
(7) 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.
Figure 9-32 To Distinguish Whether One or No Valid Edge Has Been Input with External Event Counter
Read TM1 contents
Count value
read
A
A
A = 0?
End
A+1
TM1
(b) Processing on reading count value
NO
(a) Processing on starting counting
Clear INTP0
interrupt request flag
CHAPTER 9 TIMER/COUNTER 1
YES
; Assign the number of input valid edges to A register
Start count
Start count
PIF0
YES
CE1
End
0
1
PIF0 = 1?
NO
; Clear PIF0 to 0
; Set CE1 to 1
; Check TM1 value.
; Check PIF0 contents.
If 0, check interrupt
request flag.
If 1, valid edge is input.
267

Related parts for UPD784026