English
Language : 

UPD784938 Datasheet, PDF (209/733 Pages) NEC – 16-Bit Single-Chip Microcontrollers
CHAPTER 7 REAL-TIME OUTPUT FUNCTION
7.5 Example of Use
The case in which P00 to P03 are used as a 4-bit real-time output port is shown here.
Each time the contents of timer/event counter 1 timer counter 1 (TM1) and compare register (CR10) match, the contents of
port 0 buffer register (P0L) are output to P00 to P03. At this time, the next data to be output and the timing at which the output
is to be changed next are set in the service routine for the simultaneously generated interrupt (see Figure 7-6).
See CHAPTER 10 TIMER/EVENT COUNTER 1 for the method of using timer/event counter 1.
The control register settings are shown in Figure 7-7, the setting procedure in Figure 7-8, and the processing in the interrupt
service routine in Figure 7-9.
Figure 7-6. Real-Time Output Port Operation Timing
FFH
Timer/event counter 1
0H
INTC10
interrupt request
Port 0 buffer register
P0L
CR10
CR10
CR10
D01
D02
D03
D04
CR10
Output latches
P00 to P03
D00
D01
D02
D03
Output pins Hi-Z
P00 to P03
D00
D01
D02
D03
P0L and CR10 overwritten by INTC10 interrput
P0L contents transferred to output latch on match of TM1 and CR10
Timer start
Output buffer turned on
Next data to be output is set in P0L
Initial output data is set in output latches P00 to P03
Preliminary User’s Manual U13987EJ1V0UM00
209