Japanese
HARDWARE ManualSMPC User's Manual
BackForward
SMPC User's Manual

Chapter 3 Peripheral Control


■3.1 Peripheral control mode

SH-2 can control peripherals via SMPC. There are two peripheral control methods:

(1)SMPC control mode
(2)SH-2 direct mode

◆SMPC control mode

●Block diagram

Figure 3.1 shows the block diagram of SMPC control mode. SMPC control mode is activated by setting the command parameter in IREG of the SH-2 interface register and issuing the INTBACK command. The peripheral data collection results are output to OREG as result parameters.

Figure 3.1 Block diagram of SMPC control mode

●Features

This is an effective method when you want to minimize the overhead of accessing peripherals within your application.

●Settings for using SMPC control mode

Figure 3.2 shows an example configuration for using SMPC control mode.
Figure 3.2 shows an example configuration for port 1. Note that mode settings can be set independently for each port.

Figure 3.2 Setting example of SMPC control mode

●Default value of parallel I/O register at power ON

When power is turned on, the parallel I/O registers are set to the default values shown in Table 3.1.

Table 3.1 Parallel I/O register default values at power-on
 register name
 Setting value
 Contents
 IOSEL1/2
 0H
 SMPC control mode
 EXL1/2
 0H
 PAD interrupt, VDP2 external latch disabled
 DDR1/2
 00H
 All bit input

●How to use SMPC control mode

When acquiring peripheral data using the INTBACK command, the collected peripheral data is output to OREG as a result parameter. However, the peripheral data may exceed the OREG capacity. Therefore, in SMPC control mode, peripheral data collection is interrupted every time OREG becomes full. When OREG becomes full with peripheral data, SMPC generates an SMPC interrupt and requests SH-2 to acquire peripheral data.
Also, if there is peripheral data left to collect, the status register will indicate that there is remaining data. After SH-2 acquires peripheral data, it requests continue from SMPC, and SMPC resumes peripheral data collection. Additionally, if the remaining peripheral data is not needed, peripheral data collection can be terminated by a break request. The above sequence is shown in Figure 3.3 and Figure 3.4.

・Continue request
Continuation from SH-2 to SMPC can be requested by toggling bit 7 of IREG0.

・Break request
A break from SH-2 to SMPC can be requested by writing "1" to bit 6 of IREG0.

・Notes on continue and break requests
Please note the conditions listed in Table 3.2 when requesting continues and breaks.

Table 3.2 Conditions for issuing continues and breaks
 request to issue
 Reception conditions
 SMPC operation
 conti
new
 break
 ×
 ×
 on hold
 Waiting for request
 ×
 break
 Peripheral data collection is interrupted and INTBACK command is terminated.
 ×
 Continue
 Continued peripheral data collection
 Ban
 No warranty

・Termination conditions for INTBACK command to acquire peripheral data
The INTBACK command that acquires peripheral data terminates under the following conditions.

(1) When all peripheral data collection is completed
(2) When peripheral data collection could not be completed by V-BLANK-IN (timeout)
(3) When peripheral data collection is finished due to a break request from SH-2

Figure 3.3 All peripheral data acquisition sequence

Figure 3.4 Peripheral data acquisition cancellation sequence due to break request


BackForward
HARDWARE ManualSMPC User's Manual
Copyright SEGA ENTERPRISES, LTD., 1997