Rabbit 4000 Microprocessor User's Manual |
11. Parallel Port D
11.1 Overview
Parallel Port D is a byte-wide port with each bit programmable for data direction and drive level. These are simple inputs and outputs controlled and reported in the Port D Data Register (PDDR).
All of the Parallel Port D pins have alternate output functions, and all of them can be used as inputs to various on-chip peripherals.
When used as outputs, the Parallel Port D bits are buffered, with the data written to PDDR transferred to the output pins on a selected timing edge. Either the peripheral clock or the outputs of Timer A1, Timer B1, or Timer B2 can be used for this function, with each nibble of the port having a separate select field to control this timing. Each bit can either be programmed as open-drain or driven high and low.
Because of the buffered nature of Parallel Port D, using a read-modify-write type of operation can lead to old data being written to PDDR. To alleviate this potential problem, each bit of the port can be written individually using a separate address for each bit.
Parallel Port D acts as the upper byte of the data bus when the 16-bit mode is enabled; all other functionality of Parallel Port D will be automatically disabled when 16-bit mode is in effect.
Table 11-1. Parallel Port D Pin Alternate Output Functions
Table 11-2. Parallel Port D Pin Alternate Input Functions
11.1.1 Block Diagram
11.1.2 Registers
11.2 Dependencies
11.2.1 I/O Pins
Parallel Port D uses pins PD0 through PD7. These pins can be used individually as data inputs or outputs; as serial port transmit and receive for Serial Ports A, B, E, and F; as clocks for Serial Ports CF; as external I/O strobes; or as outputs for the PWM and Timer C peripherals. In addition, Parallel Port D acts as the upper byte of the data bus (D[15:8]) when 16-bit addressing is enabled. The input capture peripheral can also watch pins PD7, PD5, PD3, and PD1.
All pins are set as inputs on startup.
The individual bits can be set to be open-drain via PDDCR.
See the associated peripheral chapters for details on how they use Parallel Port D.
11.2.2 Clocks
All outputs on Parallel Port D are clocked by the peripheral clock unless changed in PDCR, where the option of updating the Parallel Port D pins can be synchronized to the output of Timer A1, Timer B1, or Timer B2.
11.2.3 Other Registers
11.2.4 Interrupts
External interrupts can be accepted from pins PD1 or PD0; see Chapter 7 for more details.
11.3 Operation
The following steps must be taken before using Parallel Port D.
- Select the desired input/output direction for each pin via PDDDR.
- Select high/low or open-drain functionality for outputs via PDDCR.
- If an alternative peripheral output function is desired for a pin, select it by via PDALR or PDAHR and then enable it via PDFR. Refer to the appropriate peripheral chapter for further use of that pin.
- All these settings will be superseded if a 16-bit memory interface is selected since parallel port D is used for the upper half of the data bus in that mode.
Once Parallel Port D is set up, data can be read or written by accessing PDDR. The value of an output pin read in from PDDR will reflect its current output value, but any value written to an input pin will not appear until that pin becomes an output.
11.4 Register Descriptions
The corresponding port bit functions normally.
The corresponding port bit carries its alternate signal as an output. See Table 11-1.
The corresponding port bit, as an output, is driven high and low.
The corresponding port bit, as an output, is open-drain.
The corresponding port bit is input.
The corresponding port bit is an output.
These bits are ignored.
The port buffer (bit 0) is written with the value of this bit. The port buffer will be transferred to the port output register on the next rising edge of the peripheral clock
These bits are ignored.
The port buffer (bit 1) is written with the value of this bit. The port buffer will be transferred to the port output register on the next rising edge of the peripheral clock
These bits are ignored.
The port buffer (bit 2) is written with the value of this bit. The port buffer will be transferred to the port output register on the next rising edge of the peripheral clock
These bits are ignored.
The port buffer (bit 3) is written with the value of this bit. The port buffer will be transferred to the port output register on the next rising edge of the peripheral clock
These bits are ignored.
The port buffer (bit 4) is written with the value of this bit. The port buffer will be transferred to the port output register on the next rising edge of the peripheral clock
These bits are ignored.
The port buffer (bit 5) is written with the value of this bit. The port buffer will be transferred to the port output register on the next rising edge of the peripheral clock
These bits are ignored.
The port buffer (bit 6) is written with the value of this bit. The port buffer will be transferred to the port output register on the next rising edge of the peripheral clock
These bits are ignored.
The port buffer (bit 7) is written with the value of this bit. The port buffer will be transferred to the port output register on the next rising edge of the peripheral clock
Rabbit Semiconductor www.rabbit.com |