
89
12.2 Dependencies
12.2.1 I/O Pins
Parallel Port E uses the pins PE0 through PE7. These pins can be used individually as data
inputs or outputs, or as external I/O strobes; four of the Parallel Port E lines can be used as
interrupt request inputs. There is also an option to input the slave port chip select on PE7.
All pins are set as inputs on startup, and the alternate pin functions are disabled.
12.2.2 Clocks
All outputs on Parallel Port E are clocked by the peripheral clock divided by two unless
changed in PECR, where the option of updating the Parallel Port E pins can be synchro-
nized to the output of Timer A1, Timer B1, or Timer B2.
12.2.3 Other Registers
12.2.4 Interrupts
External interrupts can be accepted from pins PE5, PE4, PE1 or PE0; see
Chapter 7 for
more details.
12.3 Operation
The following steps must be taken before using Parallel Port E.
1. Select the desired input/output direction for each pin via PEDDR.
2. Use PECR to select the clock.
3. If an alternative function is desired for a pin, select it via PEFR, I0CR, I1CR, or SPCR.
Once the port is set up, data can be read or written by accessing PEDR. The value of an
output pin read in from PEDR will reflect its current output value, but any value written to
an input pin will not appear until that pin becomes an output.
On reset, PEDDR and PEFR are zeroed, making all pins inputs, and disabling the alternate
output functions. In addition certain bits 0, 1, 4, and 5 in PECR are zeroed to ensure that
data are clocked into the output registers when loaded. All other registers associated with
Parallel Port E are not initialized on reset.
Register
Function
I0CR, I1CR
Select a Parallel Port E pin as an external interrupt
input.
SPCR
Select slave chip select on PE7.