© 2000 Scenix Semiconductor, Inc. All rights reserved.
145
SX Users Manual Rev. 3.1
www.scenix.com
Chapter 5 Input/Output Ports
Schmitt trigger input (for ports other than Port A)
Port read mode (for SX48/52BD only)
Port B offers the additional option to use the port pins for the Multi-Input Wakeup/Interrupt function
and/or the analog comparator function. In some devices, other port pins can be similarly configured
for special-purpose functions.
5.3.1
Accessing the Port Control Registers
You set the configuration of a port by writing to a set of control registers associated with the port. A
special-purpose instruction is used to write or read these control registers:
mov !RA,W (move data between W and Port A control register)
mov !RB,W (move data between W and Port B control register)
mov !RC,W (move data between W and Port C control register)
mov !RD,W (move data between W and Port D control register)
mov !RE,W (move data between W and Port E control register)
Each one of these instructions writes a port control register for Port A, Port B, Port C, Port D, or Port
E. There are multiple control registers for each port. To specify which one you want to access, you use
another register called the MODE register.
5.3.2
MODE Register
The MODE register controls access to the port configuration registers. Because the MODE register is
not memory-mapped, it is accessed by the following special-purpose instructions:
mov M, #lit (move 4-bit literal to MODE register)
mov M,W (move W to MODE register)
mov W,M (move MODE register to W)
The value contained in the MODE register determines which port control register is accessed by the
mov !rx,W instruction, as indicated in Table 5-1 for the SX18/20/28AC and in Table 5-2 for the
SX48/52BD. MODE register values not listed in the table are reserved for future expansion and should
not be used. Upon reset, the MODE register is initialized to 0Fh for the SX18/20/28AC and SX18/20/
28AC75 or to 1F for the SX48/52BD, which enables write access to the port direction registers.
After you write a value to the MODE register, that setting remains in effect until you change it by
writing to the MODE register again. For example, you can write the value 1Eh to the MODE register
just once, and then write to each of the pullup configuration registers using the instructions mov
!RA,W, mov !RB,W, and so on.