Parallel Port For Intel DE-Series Boards
Parallel Port For Intel DE-Series Boards
1 Core Overview
The Parallel Port IP core provides a simple interface for general purpose I/O. This core is now deprecated. Use
Intel’s PIO Core instead.
2 Functional Description
The Parallel Port IP core can provide up to 32 I/O ports. It captures data on its inputs and drives data to its outputs,
which provides easy communication with user logic and external devices. Some example uses include:
• Controlling LEDs
• Create custom parallel port — allows users to select between using one of the presets or create a custom
parallel port.
• Presets
– I/0 device — allows users to select a preset I/O device.
– LEDs color — allows users to specify a set of LEDs that are present of some DE-series boards.
– Seven Segment Digits — allows users to specify a set of 7-segment displays when more than four are
present on the selected DE-series board.
– Expansion Header — allows users to specify expansion headers that are present on some DE-series
boards.
• Basic Settings (Presets) — This section is only visible for preset parallel ports and it shows the data width
and port direction for the selected preset configuration.
• Basic Settings — This section is only visible for custom parallel ports.
– Data Width — The width of the parallel port can be set to any integer value between 1 and 32.
– Port Direction — You can set the parallel port’s direction to one of the options shown in Table 1.
The Parallel Port IP core can have up to four registers, as shown in Table 2. These registers have a configurable data
width, n , which is set through the Platform Designer component wizard.
Not all of these registers are generated in a given parallel port interface. For example, the Direction register is
included only when a bidirectional interface is specified.
Notes on Table 2:
(1) This register may not exist, depending on the hardware configuration. If a register is not present,
reading the register returns an undefined value, and writing the register has no effect.
(2) Writing any value to edgecapture clears all bits to 0.
This register holds the n bits of data that are transferred between the Parallel Port interface and the Nios II processor.
It can be implemented as an input, output, or a bidirectional register.
Reading from the data register returns the value present at the input ports and/or the last data written to an output
port.
Writing to the data register stores the value to a register that drives the output ports. If the core is configured in
input-only mode, writing to data register has no effect. In bidirectional mode, the registered value appears on an
output port only when the corresponding bit in the direction register is set to 1 (output).
The direction register is enabled only when the Parallel Port is set to bidirectional, and is used to specify data transfer
direction for each bit. When bit n in the direction register is set to 1, the corresponding bit of the data register is set
to be output. When it si set to 0, the corresponding port bit is set as input, and is held at high-impedance state until
driven by an outside source. In the case, when the direction register does not exist, reading it returns an undefined
value, writing the direction register has no effect.
After reset, all bits of the direction register are 0, so that all bidirectional I/O ports are configured as inputs.
The interruptmask register only exists when the hardware is configured to generate IRQs. Setting a bit in the
interruptmask register to 1 enables interrupts for the corresponding bit in the parallel port’s edgecapture register.
If the core cannot generate IRQs, reading the interruptmask register returns an undefined value, and writing to the
interruptmask register has no effect.
After reset, all bits of interruptmask are zero, so that interrupts are disabled for all bits.
When the parallel port is configured to detect edges, the edgecapture register is created to indicate on which bit(s) of
the port an edge has occurred. If bit n in the edgecapture register is set to 1 whenever an edge is detected on input
port n .
The type of edge(s) to detect is specified in hardware at system generation time. The edgecapture register only exists
when the hardware is configured to capture edges. An Avalon-MM master peripheral can read the edgecapture
register to determine if an edge has occurred on any of the parallel input bits.If the core is not configured to capture
edges, reading from the edgecapture register returns an undefined value, and writing to edgecapture has no effect.
The Parallel Port core is packaged with C-language functions accessible through the hardware abstraction layer
(HAL). These functions implement basic operations for the Parallel Port.
#include "altera_up_avalon_parallel_port.h"
5 Appendix
The Parallel Port IP core differs from the PIO Core in the following ways:
• The Parallel Port core provides presets for ease of use with the simple I/Os on the DE-series boards, such as
the LEDs and Switches.
• The PIO core provides an fourth direction option, named "Both input and output ports".
• The bit set/clear option of the PIO core is not available in the Parallel Port core.
• The Parallel Port core allows for edge-sensitive interrupts, while the PIO Core additionally allows for level-
sensitive interrupts.
• For the Parallel Port core, the edge capture register is cleared when that register is read.
• The PIO core provides extra simulation support.
• The Parallel Port IP core includes device drivers that can be accessed by HAL.