This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

LPC2378: Interrupts

Hi I use an LPC2378 and try to timer1 to generate an interrupt, but it not happen.

VIC begin:

static void initVIC(void)
{
    uint32 *vect_addr, *vect_prio;
    int i = 0;
    VICIntEnClr = 0xFFFFFFFF;
    VICProtection = 0x0;
    VICSoftIntClear = 0xFFFFFFFF;
    VICIntSelect = 0x0;
    VICSWPriorityMask = 0xFFFF;

    for(i = 0; i < 32; i++) {
        vect_addr = (uint32 *)(LPC2378_VIC_BASE + VECT_ADDR_INDEX + (i*4));
        *vect_addr = 0x0;
    }

    for(i = 0; i < 32; i++) {
        vect_prio = (uint32 *)(LPC2378_VIC_BASE + VECT_PRIO_INDEX + (i*4));
        *vect_prio = 0xF;
    }

    return;
}

set ISR:

void installIntr(pISR intSR, eIF IRQorFIQ, uint32 prio, uint32 vectorNum)
{
    if( IRQorFIQ == bIRQ ) { VICIntSelect = 0x0; }
    else if( IRQorFIQ == bFIQ ) { VICIntSelect |= 0x20; }

    VICIntEnable |= 0x20;

    uint32* VectBasePrio;
    VectBasePrio = (uint32*)&(VICVectPriority0);

    pISR* VectBaseAddr;
    VectBaseAddr = (pISR*)&(VICVectAddr0);

    VectBaseAddr= (pISR*)((&(VICVectAddr0)) + (vectorNum*4));
    *VectBaseAddr= intSR;

    VectBasePrio = (uint32*)((&(VICVectPriority0)) + (vectorNum*4));
    *VectBasePrio = prio;

    return;
}

disable ISR with:

    MRS     R0, SPSR
    ORR     R0, R0, #0xC0
    MSR     SPSR_c, R0
    MOVS    PC, LR

... and enable with the same but ORR -> BIC.

Also IRQ int set to: ldr pc, [pc, #-0x120]

Any help much grateful :)