
C165UTAH
DMA - External PEC (EPEC)
Data Sheet
101
2001-02-23
Note:
If the EPEC is not enabled, then no transfer is possible.
The sequence of operations is as follows:
1. The USB block will generate FIFO request signals as soon as the system reset was
deassert-ed. It thus signals to the EPEC that the USB FIFOs are ready to receive data.
2. Now the USB has to be configured. The EPEC channel that serves USB
endpoint_0_IN is setup with source and destination pointer, the EPEC control register
is programmed with the number of bytes that need to be transfered and the bit for
external/ internal source has to be set according to the application.
3. Now the EPEC channel for endpoint_0_IN can be activated by setting the enable bit
in EPEC control register for endpoint_0_IN.
4. The transfer of configuration data to the USB FIFO for endpoint_0_IN starts because
the USB FIFO has signaled that there is space available and the EPEC channel has
been enabled.
5. After the EPEC byte counter has reached the number of bytes that have to be
transfered, the EPEC channel disables itself and indicates the transmit end of data
condition in the EPEC interrupt register.
6. The indication of the transmit end of data condition triggers the generation of the
EPEC interrupt pulse to the CPU on the irq(40) line.
7. After the interrupt generation unit has generated the interrupt pulse it waits for a write
to the interrupt register. It then is ready to generate the next interrupt pulse to the CPU.
If no write to the interrupt register takes place, no new interrupt pulse can be asserted.
6.5
Implementation of EPEC Interrupt Generation Unit
Currently the EPEC interrupt controller implements a clear on write functionality.
This implies the following for the interrupt routine:
1. One of two conditions generates an entry into the EPEC interrupt register: either a
channel start or a channel transmit end of data (for endpoint 0 this functionality is
reduced to start for direction in, EPEC transmit; and end for direction out, EPEC
receive; otherwise we would have more than 16 interrupts). The generation of the
entries into the EPEC interrupt register can be controled by programming the EPEC
interrupt mask register.
2. The interrupt routine is triggered by the interrupt pulse that the EPEC interrupt
controller gernerates on irq(40).
3. The routine should then read the EPEC interrupt register to determine the source of
the interrupt.
4. The interrupt has to be acknowledged by writing a ‘1’ to the position of the interrupt
source in the EPEC interrupt register.
5. Now the interrupt controller is ready to generate the next interrupt pulse.