HARDWARE ManualSMPC User's Manual
BackForward
SMPC User's Manual / Chapter 2 SMPC Commands

■ 2.2 Command issuance

Commands to SMPC can be issued by setting the SMPC status flag (SF) to "1", setting command parameters if required, and writing the command code to the SH-2 interface register.
When issuing SMPC commands, be careful about double issuing of commands. Prevention of double command issuance to SMPC can be managed by the SMPC status flag. When this flag is "1", SMPC makes it busy. When issuing a command, make sure that the status flag is "0", set "1", and then issue the command. The status flag is reset to "0" by SMPC at the end of the command.

◆ Command issuance method

SMPC commands can be classified according to the command execution content, command parameters, and result parameter types for issuing procedures and result parameter acquisition methods. Table 2.4 shows the classifications and applicable commands, and Figures 2.1 to 2.5 show examples of issuance methods for each classification.

(1) Category A:
A command that resets the master SH-2 or transitions to exception handling such as NMI after the command is issued.

(2) Classification B:
Commands that do not require command parameter settings and do not return result parameters (except for OREG31)

(3) Classification C:
Commands that require command parameter settings and do not return result parameters (except for OREG31)

(4) Classification D:
A command that requires command parameter setting, returns result parameters, and requests SMPC interrupts when the result parameters are complete.

Table 2.4 Command issuance classification
 Classification
 command
 A
 MSHON , SYSRES , NMIREQ, CKCHG352 , CKCHG320
 B
 SSHON, SSHOFF, SNDON, SNDOFF, CDON , CDOFF , RESENAB, RESDISA
 C
 SETTIME, SETSMEM
 D
 INTBACK
Bold type is the user's prohibited command.

Figure 2.1 Category A Command Flow

Figure 2.2 Category B Command Flow

Figure 2.3 Classification C Command Flow

Figure 2.4 Category D Command Flow

Note) Masking SMPC interrupts (without using SMPC interrupts), SMPC interrupt flag and SF
The same processing as the SMPC interrupt routine can be executed by polling the clear after issuing the command.

◆ Command issuance timing

SMPC uses V-BLANK-IN interrupts to perform internal tasks. Therefore, issuing commands from V-BLANK-IN in a period of 300 μS is prohibited. In addition, the INTBACK command used to acquire various SMPC statuses and peripheral data stipulates the issuance timing more strictly than other commands. For details on the INTBACK command, refer to ■ 2.4 Non-reset system management commands and Chapter 3 Peripheral Control .

● Common items of command issuance timing
As mentioned above, issuance of all commands is prohibited from V-BLANK-IN for a period of 300 μS.

● INTBACK command
The INTBACK command starts peripheral data collection on V-BLANK-OUT. Issue the peripheral data collection with V-BLANK-OUT in the period after V-BLANK-IN to start, after 300 μS, and before V-BLANK-OUT. Figure 2.5 shows the timing of issuing the INTBACK command.

The INTBACK command can be used in three ways:

(1) Obtain only SMPC status
(2) Acquire peripheral data following acquisition of SMPC status
(3) Acquire only peripheral data

(2) When performing peripheral data acquisition following SMPC status acquisition, an SMPC interrupt occurs when the SMPC status is set to OREG, and SH2 is requested to acquire the result parameters. After SH2 requests to continue, SMPC will start collecting peripheral data. Therefore, when making a continue request after acquiring the SMPC status, it is necessary to issue the INTBACK command to request the continuation so that the peripheral data collection can be started with V-BLANK-OUT. After issuing the INTBACK command, SMPC status acquisition is completed in about 300 μS, and SMPC interrupts are requested from SMPC.

Figure 2.5 INTBACK command issuance timing

● INTBACK command issuance timing after executing SYSRES, CKCHG320, CKCHG352 commands
With the above commands, the command execution time takes 100 msec or more. When issuing the INTBACK command after executing these commands, wait until the next V-BLANK-IN before issuing. Figure 2.6 shows the timing of issuing the INTBACK command after executing the SYSRES, CKCHG320, and CKCHG352 commands. The SYSRES, CKCHG320, and CKCHG352 commands should be issued after V-BLANK-IN, after 300 μS, and before the next V-BLANK-IN.

Be sure to use the system library when using the clock change command.

Figure 2.6 Timing of issuing INTBACK command after executing SYSRES, CKCHG320, CKCHG352 command

● Issuance timing of other commands
If you do not issue the INTBACK command in the same frame after issuing other commands, issue them after V-BLANK-IN, after 300 μS, and before the next V-BLANK-IN. When issuing other commands after V-BLANK-IN at 300 μS or later and then issuing the INTBACK command in the same frame, issue the INTBACK command in the period before V-BLANK-OUT. Figure 2.7 shows the timing of issuing other commands.

Figure 2.7 Issuing other commands

◆ Command issuance restrictions

The restrictions on issuing commands are shown below.

● Please perform the command issuance process for SMPC in a single task as much as possible. If the issuance process is divided into multiple parts, problems such as double command issuance may occur, causing SMPC malfunction or deadlock. If it is unavoidable to issue commands to SMPC for multiple tasks, be sure to add exclusive control to prevent double command issuance between tasks in addition to the above command issuance method. ..

● Even when issuing commands consecutively, be sure to check the status flag so that double command issuance does not occur, and then issue the next command after the previous command execution is completed.

● The real-time clock is counted up once every second. Immediately after V-BLANK-IN, the reset button is detected inside the SMPC. Note that if you issue a command while these processes are being performed, the command processing time will fluctuate because these processing times will be added to the command processing time.

● SMPC commands can be issued from both the master and slave SH-2, but there are some commands that are restricted from being issued, such as when the system stops operating.

Table 2.5 shows the restrictions on issuing each SH-2 command.

Table 2.5 SH-2 command issuance restrictions
No. Command name Command abbreviation Command issuance from master SH-2 Command issuance from slave SH-2
1 × Master SH-2 ON MSHON
2 Slave SH-2 ON SSHON ×
3 Slave SH-2 OFF SSHOFF ×
Four Sound ON SNDON
Five Sound OFF SNDOFF
6 × CD ON CDON
7 × CD OFF CDOFF
8 × Whole system reset SYSRES
9 × Clock change 352 CKCHG352 ×
Ten × Clock change 320 CKCHG320 ×
11 NMI request NMIREQ
12 Reset enable RESENAB
13 Reset disable RESDISA
14 Interrupt back INTBACK ×
15 SMPC memory settings SETSMEM
16 Time setting SETTIME
X mark indicates prohibition of use by users

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