English
Language : 

HD6475328-CP10 Datasheet, PDF (143/459 Pages) Hitachi Semiconductor – original Hitachi CMOS microcomputer unit (MCU)
6.5 Example
Purpose: To receive 128 bytes of serial data via the serial communication interface.
Conditions:
• Operating mode: Minimum mode
• Received data are to be stored in consecutive addresses starting at H'FC00.
• DTC control register information for the RXI interrupt is stored at addresses H'FB80 to H'FB87.
• Accordingly, the DTC vector table contains H'FB at address H'00AA and H'80 at address
H'00AB.
• The desired interrupt mask level in the CPU status register is 4, and the desired SCI interrupt
priority level is 5.
Procedure
1. The user program sets DTC control register information in addresses H'FB80 to H'FB87 as
shown in table 6-7.
Table 6-7 DTC Control Register Information Set in RAM
Address
H'FB80
H'FB82
H'FB84
H'FB86
Register
DTMR
DTSR
DTDR
DTCR
Description
Byte transfer
Source address fixed
Increment destination address
Address of SCI receive data register
Address H'FC00
Number of bytes to be received: 128
Value Set
H'2000
H'FFDD
H'FC00
H'0080
2. The program sets the RI (SCI Receive Interrupt) bit in the data transfer enable register (bit 5 of
register DTED) to “1.”
3. The program sets the interrupt mask in the CPU status register to 4, and the SCI interrupt
priority in bits 6 to 4 of interrupt priority register IPRD to 5.
4. The program sets the SCI to the appropriate receive mode, and sets the receive interrupt enable
(RIE) bit in the serial control register (SCR) to “1” to enable receive interrupts.
5. Thereafter, each time the SCI receives one byte of data, it requests an RXI interrupt, which the
interrupt controller directs toward the DTC. The DTC transfers the byte from the SCI’s receive
data register (RDR) into RAM, and clears the interrupt request before ending.
125