Home
Welcome
Information


FPGA projects
Basic
Music box
LED displays
Pong game
R/C servos
Text LCD module
Quadrature decoder
PWM and one-bit DAC
Debouncer
Crossing clock domains
External contributions

Interfaces
RS-232
JTAG
I2C
EPP
SPI
PCI
PCI Express
10BASE-T

Advanced
Digital oscilloscope
Graphic LCD panel
Direct Digital Synthesis
CNC steppers
Spoc CPU core

Hands-on
A simple oscilloscope


FPGA introduction
What are FPGAs?
How FPGAs work
Internal RAM
FPGA pins
Clocks and global lines
Download cables
Configuration
Learn more

FPGA software
Design software
Pin assignment
Design-entry/HDL
Simulation/HDL
Synthesis and P&R

FPGA electronic
SMD technology
Crystals and oscillators

HDL info
HDL tutorials
Verilog tips
VHDL tips

Quick-start guides
ISE
Quartus

Site
News
FPGA links
HDL tutorials
Forum


EPP - The software

EPP software support is very simple. Let's see.

BIOS

First go into your PC's BIOS (accessible at power-up) and enable EPP (in the parallel port properties).

Parallel port address

From the software point of view, EPP transactions require IO reads or writes.

The most common EPP port address is 0x378. Find it in Window's control panel.

C functions

First the EPP_init() function.

#define EPP_port_addr 0x378	// your parallel port address

void EPP_init()
{
	IO_WRITE(EPP_port_addr+2, 0x04);
}

Simple, right?

Actually, you might need to write the IO functions yourself if your compiler doesn't provide them.

void IO_WRITE(WORD addr, BYTE data)
{
	_asm
	{
		mov dx, addr
		mov al, data
		out dx, al
	}	
}

BYTE IO_READ(WORD addr)
{
	_asm
	{
		mov dx, addr
		in al, dx
	}
}

Now we saw that EPP supports four types of transaction. Let's write one function for each.

void EPP_write_addr(BYTE address)
{
	IO_WRITE(EPP_port_addr+3, address);
}

void EPP_write_data(BYTE data)
{
	IO_WRITE(EPP_port_addr+4, data);
}

BYTE EPP_read_addr()
{
	return IO_READ(EPP_port_addr+3);
}

BYTE EPP_read_data()
{
	return IO_READ(EPP_port_addr+4);
}

That's all.
The EPP hardware handles all the EPP protocol details, so that the software doesn't have to do much.



>>> NEXT: EPP - The hardware protocol >>>



This page was last updated on September 12 2006.