Specifications
Embedded System Tools Guide (EDK 6.2i) www.xilinx.com 337
UG111 (v1.4) January 30, 2004 1-800-255-7778
Example Systems for PowerPC
R
XTmrCtr_mSetLoadReg(XPAR_MYTIMER_BASEADDR, 0,
(timer_count*timer_count+1) * 1000000);
/* reset the timers, and clear interrupts */
XTmrCtr_mSetControlStatusReg(XPAR_MYTIMER_BASEADDR, 0,
XTC_CSR_INT_OCCURED_MASK | XTC_CSR_LOAD_MASK );
/* Enable timer and uart interrupts in the interrupt controller */
XIntc_mEnableIntr(XPAR_MYINTC_BASEADDR,
XPAR_MYTIMER_INTERRUPT_MASK);
/* start the timers */
XTmrCtr_mSetControlStatusReg(XPAR_MYTIMER_BASEADDR, 0,
XTC_CSR_ENABLE_TMR_MASK | XTC_CSR_ENABLE_INT_MASK |
XTC_CSR_AUTO_RELOAD_MASK | XTC_CSR_DOWN_COUNT_MASK);
/* Wait for interrupts to occur */
while (1)
;
}
Example Systems for PowerPC
System without Interrupt Controller (Single Interrupt Signal)
An interrupt controller is not required if there is a single interrupting peripheral or an
external interrupting pin and its interrupt signal is level sensitive. Note that a single
peripheral may raise multiple interrupts. In this case, an interrupt controller is required.
Procedure
To set up a system without an interrupt controller that handles only one level sensitive
interrupt signal, the following steps must be taken:
1. The MHS and MSS file must be set up as follows:
i The interrupt signal of the peripheral(or the external interrupt signal) must be
connected to one of the interrupt inputs (critical or non-critical) of the PowerPC in
the MHS file.
i The peripheral must be given an instance name using the INSTANCE keyword in
the MHS file. Libgen creates a definition in xparameters.h (OUTPUT_DIR/PROC
INST NAME/include) for XPAR_INSTANCE_NAME_BASEADDR mapped to
the base address of this peripheral.
2. The interrupt handler routine that handles the signal should be written. The base
address of the peripheral instance is accessed as
XPAR_INSTANCE_NAME_BASEADDR.
3. The handler function is then designated to be an interrupt handler for the signal using
the INT_HANDLER keyword in the MSS file. Refer to Chapter 19, “Microprocessor
Software Specification (MSS)” for more information. The peripheral instance is first
selected in the MSS file, and then the INT_HANDLER attribute is given the function
name. In case of an external interrupt signal, the INT_HANDLER attribute is given as
a global parameter in the MSS file. The attribute is not part of any block in the MSS.










