Configuring The Slave Port - Intel 8XC196NT User Manual

Table of Contents

Advertisement

8XC196NT USER'S MANUAL
9.5

CONFIGURING THE SLAVE PORT

Before you can use the slave port, you must configure the associated port 3 and port 5 pins to
serve as special-function signals. (See Chapter 6, "I/O Ports," for configuration details.)
Configure P5.3:0 as special-function inputs.
Configure P5.4 as a special-function open-drain or complementary output.
Configure P3.7:0 as special-function open-drain input/outputs.
The following code example shows the port 5 configuration code.
LDB
TEMP, #EFH
STB
TEMP, P5_DIR[0]
LDB
TEMP, #1FH
STB
TEMP, P5_MODE[0]
LDB
TEMP, #FFH
STB
TEMP, P5_REG[0]
The following code example shows the port 3 configuration code.
LDB
TEMP, P34_DRV[0]
ANDB TEMP, #7FH
STB
TEMP, P34_DRV[0]
Once you have configured the pins, you must initialize the registers. This example shows the ini-
tialization code. The remaining sections of this chapter describe the registers and explain the con-
figuration options.
LDB
TEMP, #slave_mode
STB
TEMP, SLP_CON[0]
STB
ONES_REG, P3_REG[0]
STB
ZERO_REG, SLP_CMD[0]
STB
ZERO_REG, P3_PIN[0]
LDB
TEMP, SLP_STAT[0]
9.5.1
Programming the Slave Port Control Register (SLP_CON)
The SLP_CON register (Figure 9-6) selects the operating mode, enables and disables slave port
operation, controls whether the master accesses the data registers or the control and status regis-
ters, and controls whether the SLPINT signal is asserted when the input buffer empty (IBE) and
output buffer full (OBF) flags are set in the SLP_STAT register. Only the slave can access this
register.
9-14
; make P5.4/SLPINT a complementary output
; set up all other port 5 pins as inputs
; select special function for P5.4:0
; write all ones to P5_REG
; read the current state of P34_DRV
; clear the MSB of P34_DRV
; make Port 3 open-drain
; 0FH for standard, 1BH for shared mem mode
; initialize the slave port
; write all ones to port 3 (write sets OBF)
; clear the command register
; clear the data input register
; read the status reg (CBE, IBE, OBF=111)

Advertisement

Table of Contents
loading

Table of Contents