Rabbit 4000 Microprocessor User's Manual |
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 chipthe 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
9.1.1 Block Diagram
9.1.2 Registers
Port B Data Register
Port B Data Direction Register
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
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.
- 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.
- 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
The corresponding port bit is input.
The corresponding port bit is an output.
Rabbit Semiconductor www.rabbit.com |