Rabbit 4000 Microprocessor User's Manual |
10. Parallel Port C
10.1 Overview
Parallel Port C 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 C Data Register (PCDR).
All the Parallel Port C pins have alternate output functions, and most of them can be used as inputs to various on-chip peripherals.
Table 10-1. Parallel Port C Pin Alternate Output Functions
Table 10-2. Parallel Port C Pin Alternate Input Functions
After reset, the default condition for Parallel Port C is four outputs (the even-numbered bits) and four inputs (the odd-numbered bits). For compatibility with the Rabbit 2000 and the Rabbit 3000 microprocessors, these outputs are driven with a logic zero (low) on PC6 and a logic one (high) on PC4, PC2, and PC0. When PCDR is read, the value of the voltage on the pin is returned. If the pin is an output, the value it is set to is returned.
10.1.1 Block Diagram
10.1.2 Registers
Port C Data Register
Port C Data Direction Register
Port C Alternate Low Register
Port C Alternate High Register
Port C Drive Control Register
Port C Function Register
10.2 Dependencies
10.2.1 I/O Pins
Parallel Port C uses pins PC0 through PC7. These pins can be used individually as data inputs or outputs; as serial port transmit and receive for Serial ports AF; as clocks for Serial Ports CF; as external I/O strobes; or as outputs for the PWM and Timer C peripherals. The input capture peripheral can also watch pins PC7, PC5, PC3, and PC1.
On startup, PC4, PC2, and PC0 are outputs set high, PC6 is set low, and the other pins are inputs for compatibility with the Rabbit 3000.
The individual pins can be set to be open-drain via PCDCR.
See the associated peripheral chapters for details on how they use Parallel Port C.
10.2.2 Clocks
All outputs on Parallel Port C are clocked by the peripheral clock.
10.2.3 Other Registers
SACR, SBCR, SCCR, SDCR, SECR, SFCR
Select a Parallel Port C pin as serial data (and optional clock) input.
ICS1R, ICS2R
Select a Parallel Port C pin as a start/stop condition input.
10.2.4 Interrupts
There are no interrupts associated with Parallel Port C.
10.3 Operation
The following steps must be taken before using Parallel Port C.
- Select the desired input/output direction for each pin via PCDDR.
- Select driven or open-drain functionality for outputs via PCDCR.
- If an alternate peripheral output function is desired for a pin, select it via PCALR or PCAHR and then enable it via PCFR. Refer to the appropriate peripheral chapter for further use of that pin.
Once the port is set up, data can be read or written by accessing PCDR. The value in PCDR 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.
10.4 Register Descriptions
The corresponding port bit is an input.
The corresponding port bit is an output.
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 functions normally.
The corresponding port bit carries its alternate signal as an output. See Table 10-1.
Rabbit Semiconductor www.rabbit.com |