From: axalay on
Hello. I have a problem with use opb_intc in my projekt
In mhs:
# External Interrupts
PORT IrqSecond_pin = IrqSecond, DIR = I, SIGIS = Interrupt,
SENSITIVITY = LEVEL_HIGH
PORT IrqPci_pin = IrqPci, DIR = I, SIGIS = Interrupt, SENSITIVITY =
LEVEL_HIGH
PORT IrqFrame_pin = IrqFrame, DIR = I, SIGIS = Interrupt, SENSITIVITY
= LEVEL_HIGH

BEGIN ppc405
PARAMETER INSTANCE = ppc405_0
PARAMETER HW_VER = 2.00.c
BUS_INTERFACE JTAGPPC = jtagppc_0_0
BUS_INTERFACE IPLB = plb
BUS_INTERFACE DPLB = plb
PORT PLBCLK = sys_clk_s
PORT C405RSTCHIPRESETREQ = C405RSTCHIPRESETREQ
PORT C405RSTCORERESETREQ = C405RSTCORERESETREQ
PORT C405RSTSYSRESETREQ = C405RSTSYSRESETREQ
PORT RSTC405RESETCHIP = RSTC405RESETCHIP
PORT RSTC405RESETCORE = RSTC405RESETCORE
PORT RSTC405RESETSYS = RSTC405RESETSYS
PORT CPMC405CLOCK = proc_clk_s
PORT EICC405EXTINPUTIRQ = opb_intc_interrupt
END

BEGIN opb_iic
PARAMETER INSTANCE = Generic_IIC_Bus
PARAMETER HW_VER = 1.02.a
PARAMETER C_CLK_FREQ = 100000000
PARAMETER C_BASEADDR = 0x40800000
PARAMETER C_HIGHADDR = 0x4080ffff
BUS_INTERFACE SOPB = opb
PORT Scl_O = fpga_0_Generic_IIC_Bus_Scl_O
PORT Sda_I = fpga_0_Generic_IIC_Bus_Sda_I
PORT Sda_O = fpga_0_Generic_IIC_Bus_Sda_O
PORT IP2INTC_Irpt = irq_iic
END

BEGIN opb_intc
PARAMETER INSTANCE = opb_intc_0
PARAMETER HW_VER = 1.00.c
PARAMETER C_BASEADDR = 0x43e14000
PARAMETER C_HIGHADDR = 0x43e140ff
BUS_INTERFACE SOPB = opb
PORT Irq = opb_intc_interrupt
PORT Intr = irq_iic & IrqFrame & IrqPci & IrqSecond
END

In mss:
PARAMETER VERSION = 2.2.0
PARAMETER int_handler = ext_int_handler, int_port = IrqSecond
PARAMETER int_handler = ext_int_handler, int_port = IrqPci
PARAMETER int_handler = ext_int_handler, int_port = IrqFrame

In programm:
/* Initialize exception handling */
XExc_Init();

/* Register external interrupt handler */
XExc_RegisterHandler(XEXC_ID_NON_CRITICAL_INT,
(XExceptionHandler)XIntc_DeviceInterruptHandler, (void *)0);

/* Connect interrupt handler that will be called when an interrupt
occurs */
XIntc_RegisterHandler(XPAR_OPB_INTC_0_BASEADDR,0,
(XInterruptHandler)IrqSecondHandler, (void *)0);
XIntc_RegisterHandler(XPAR_OPB_INTC_0_BASEADDR,1,
(XInterruptHandler)IrqPciHandler, (void *)0);
XIntc_RegisterHandler(XPAR_OPB_INTC_0_BASEADDR,2,
(XInterruptHandler)IrqFrameHandler, (void *)0);
XIntc_RegisterHandler(XPAR_OPB_INTC_0_BASEADDR,3,
(XInterruptHandler)IrqIicHandler, (void *)0);

/* Start the interrupt controller */
XIntc_mMasterEnable(XPAR_OPB_INTC_0_BASEADDR);

/* Enable interrupts in the interrupt controller */
XIntc_mEnableIntr(XPAR_OPB_INTC_0_BASEADDR, 0x1|0x2|0x4|0x8);

/* Enable PPC non-critical interrupts */
XExc_mEnableExceptions(XEXC_NON_CRITICAL);

Where error?
From: Brian Drummond on
On Mon, 21 Apr 2008 08:12:15 -0700 (PDT), axalay <axalay(a)gmail.com> wrote:

>Hello. I have a problem with use opb_intc in my projekt

>Where error?

Give us a clue ... what error?

If the PC ends up at the "unhandled exception" handler address, check that your
interrupt vector table is on a 64K boundary. Only the top 16 bits of the
interrupt vector table address is actually used in the PPC. So if your table
isn't on a boundary, the PPC doesn't vector to where you think it does.

- Brian

From: axalay on

> Give us a clue ... what error?
>
> If the PC ends up at the "unhandled exception" handler address, check that your
> interrupt vector table is on a 64K boundary. Only the top 16 bits of the
> interrupt vector table address is actually used in the PPC. So if your table
> isn't on a boundary, the PPC doesn't vector to where you think it does.
>
> - Brian

Hello Brian.
This project is compile without error.
When I generate interrupt-my programm is hang.
I plase breakpoint in all interrupt handler functions, but program is
not jump at that breakpoints.
Size of my memory is 64K.
From: Brian Drummond on
On Tue, 22 Apr 2008 23:05:25 -0700 (PDT), axalay <axalay(a)gmail.com> wrote:

>
>> Give us a clue ... what error?
>>
>> If the PC ends up at the "unhandled exception" handler address, check that your
>> interrupt vector table is on a 64K boundary. Only the top 16 bits of the
>> interrupt vector table address is actually used in the PPC. So if your table
>> isn't on a boundary, the PPC doesn't vector to where you think it does.
>>
>> - Brian
>
>Hello Brian.
>This project is compile without error.
>When I generate interrupt-my programm is hang.
>I plase breakpoint in all interrupt handler functions, but program is
>not jump at that breakpoints.
>Size of my memory is 64K.

Check the base address of your interrupt vector table.
- Brian