Rabbit 4000 Microprocessor
User's Manual
PREV INDEX NEXT


9. Parallel Port B

9.1 Overview

Parallel Port B is a byte-wide port with each bit programmable for direction. The Parallel Port B pins are also used to access other peripherals on the chip—the slave port, the auxiliary I/O address bus, and clock I/O for clocked serial mode option for Serial Ports A and B. The Slave Port Control Register (SPCR) is used to configure how Parallel Port B is used when selecting the slave port or the auxiliary I/O bus modes.

When the slave port is enabled, either under program control or during parallel bootstrap, Parallel Port B pins carry the Slave Attention output signal, and four of the inputs carry the Slave Read strobe, Slave Write strobe, and Slave Address bits. The Slave Chip Select can also be programmed to come from a Parallel Port B pin.

When the auxiliary I/O bus option is enabled, either six or eight pins carry the external I/O address signals selected in SPCR.

Two pins are used for the clocks for Serial Ports A and B when they are configured for the clocked serial mode. These two inputs can be used as clock outputs for these ports if selected in the respective serial port control registers. Note that the clocked serial output clock selection overrides all other programming for the two relevant Parallel Port B pins.

Table 9-1. Parallel Port B Pin Alternate Output Functions

Pin Name

Slave Port

Serial Ports A–D

Auxiliary I/O Bus

PB7
/SLVATN

IA5
PB6
/SCS

IA4
PB5
SA1

IA3
PB4
SA0

IA2
PB3
/SRD

IA1
PB2
/SWR

IA0
PB1

SCLKA
IA7
PB0

SCLKB
IA6


9.1.1 Block Diagram


9.1.2 Registers

Register Name

Mnemonic

I/O Address

R/W

Reset

Port B Data Register
PBDR
0x0040
R/W
00xxxxxx
Port B Data Direction Register
PBDDR
0x0047
R/W
11000000


9.2 Dependencies

9.2.1 I/O Pins

Parallel Port B uses pins PB0 through PB7. These pins can be used individually as data inputs or outputs; as the address bits for the auxiliary I/O bus; as control signals for the slave port; or as clocks for Serial Ports A and B.

On startup, bits 6 and 7 are outputs set low for backwards compatibility with the Rabbit 2000. All other pins are inputs.

Note that when the auxiliary I/O bus or slave port is enabled in SPCR, the Parallel Port B pins associated with those peripherals perform those actions, no matter what the settings are in PBDR or PBDDR. See the associated peripheral chapters for details on how they use Parallel Port B.

9.2.2 Clocks

All outputs on Parallel Port B are clocked by the peripheral clock (perclk).

9.2.3 Other Registers

Register

Function

SPCR
Sets the Parallel Port B function for some pins if the slave port or auxiliary I/O bus is enabled.


9.2.4 Interrupts

There are no interrupts associated with Parallel Port B.

9.3 Operation

The following steps must be taken before using Parallel Port B.

  1. Select the desired input/output direction for each pin via PBDDR. Note that this setting is superseded for some pins if the slave port or auxiliary I/O bus is enabled in SPCR or if the clocked serial mode is enabled for serial ports A or B.

  2. If the slave port or the auxiliary I/O bus is selected, refer to the chapters for those peripherals for further setup information.

Once the port is set up, data can be read or written by accessing PBDR. The value in PBDR of an output pin will reflect its current output value, but any value written to an input pin will not appear until that pin becomes an output.

9.4 Register Descriptions

Parallel Port B Data Register (PBDR) (Address = 0x0040)

Bit(s)

Value

Description

7:0
Read
The current state of Parallel Port B pins PB7–PB0 is reported.
Write
The Parallel Port B buffer is written with this value for transfer to the Parallel Port B output register on the next rising edge of the peripheral clock.


Parallel Port B Data Direction Register (PBDDR) (Address = 0x0047)

Bit(s)

Value

Description

7:0
0
The corresponding port bit is input.
1
The corresponding port bit is an output.


Slave Port Control Register (SPCR) (Address = 0x0024)

Bit(s)

Value

Description

7
0
Program fetch as a function of the SMODE pins.
1
Ignore the SMODE pins program fetch function.
6:5
Read
These bits report the state of the SMODE pins.
Write
These bits are ignored and should be written with zero.
4:2
000
Disable the slave port. Parallel Port A is a byte-wide input port.
001
Disable the slave port. Parallel Port A is a byte-wide output port.
010
Enable the slave port, with /SCS from Parallel Port E bit 7.
011
Enable the auxiliary I/O bus. Parallel Port A is used for the data bus and Parallel Port B[7:2] is used for the address bus.
100
This bit combination is reserved and should not be used.
101
This bit combination is reserved and should not be used.
110
Enable the slave port, with /SCS from Parallel Port B bit 6.
111
Enable the auxiliary I/O bus. Parallel Port A is used for the data bus and Parallel Port B[7:0] is used for the address bus.
1:0
00
Slave port interrupts are disabled.
01
Slave port interrupts use Interrupt Priority 1.
10
Slave port interrupts use Interrupt Priority 2.
11
Slave port interrupts use Interrupt Priority 3.



Rabbit Semiconductor
www.rabbit.com
PREV INDEX NEXT