2.4 Multi-Function Timer
104
Chapter 2: Hardware
(3) Use of Expanded Intelligent I/O Services
a) Transferring Data to the Compare Register
Any of trigger input interrupt, zero-detect interrupt and overflow/compare-match interrupt signals
alone may use the expanded intelligent I/O service (EI2OS), but by setting the IIOS bit in the TCSR
register to ‘1,’ it becomes possible for the zero-detect interrupt to output three interrupt requests.
This makes it possible to use EI2OS to update a maximum of 65,536 data values on three channels
after every zero-detect interrupt.
In the following example, data is updated on the three output data compare buffer registers OCPBR1
to OCPBR3.
(1) First, EI2OS descriptors are allocated to three channels for the OCPBR1 to OCPBR3 buffer
registers.
ICR2 (00B2H)
← 008H: select channel 0
ICR3 (00B3H)
← 018H: select channel 1
ICR4 (00B4H)
← 028H: select channel 2
(2) The EI2OS descriptors are set up.
Table 2.4.2 EI2OS Descriptor Settings
EI2OS is started by a zero-detect event, and data is transferred to the OCPBR1 to OCPBR3 buffer
registers from the RAM area designated for each channel. In this example, EI2OS is started three
times in the sequence ICR02, 03, 04 and data is transferred continuously to OCPBR1, 2, 3 in
word-length units.
After the number of transfer cycles designated by the data counter (15 cycles in this example),
the interrupt routine is executed over each channel. In this example, the sequence will be 15
transfer cycles to OCPBR1 followed by the interrupt routine corresponding to ICR02, then 15
transfer cycles to OCPBR2 and the interrupt routine corresponding to ICR03, then 15 transfer
cycles to OCPBR3 and the interrupt routine corresponding to ICR04. If necessary, the user may
disable EI2OS within the interrupt subroutine, and re-enter settings as needed.
Fig. 2.4.18 Use of EI2OS Data Transfer
ICR2 (from 0100H) ICR3 (from 0100H) ICR4 (from 0100H)
Comment
BAP (buffer address pointer)
RAM address (1)
RAM address (2)
RAM address (3)
Transfer source address
ISCS (I2OS status)
01AH
Transfer method setting *1
IOA (I/O address pointer)
04AH
04CH
04EH
Transfer destination address
(OCPBR1 to OCPBR3)
DTC (data counter)
00FH
Data count (15 cycles)
*1:
Setting designates: I/O address not updated, buffer (RAM) address updated, buffer
→ I/O transfer, word transfer.
Buffer address
Higher address
Data for OCPBR3 (RAM address 3)
Data for OCPBR2 (RAM address 2)
Data for OCPBR1 (RAM address 1)
pointer is
incremented
by +2
OCPBR3
00004A H
OCPBR2
00004C H
OCPBR1
00004E H
0
15
RAM