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

LPC2919 cant write in Registers for Event Router

Hey Community,

it seems i have a strange problem with my LPC2919. I want to write a driver for a keyboard. For that i need a extern interrupt for the Clock signal. The problem is, it seems i cant write on the Registers ER_MASK_SET and ER_MASK_CLR. Thats my code to initialisize the EXT3 at the SFSP2_7 pin.

void atkeyb_init(void)
{
        inpt = kb_buffer;// Initialize buffer
        outpt = kb_buffer;
        DWORD regVal;
        DWORD test, mu,du,er;
        atkeyb_buffcnt = 0;
        GPIO2_DR&=~(1<<KEYB_DATA_PIN);     //input
        GPIO2_DR &=~(1<<KEYB_CLOCK_PIN);   //Input
        //KEYB_DATA_PORT&=~(1<<KEYB_DATA_PIN);

        ER_APR &= ~(1<<3);  // active LOW -> falling edge
        ER_ATR |=(1<<3); // event is latched-> need to clear the flag on ur own

        SFSP2_7 = (1<<1)|(1<<2)|(1<<3); //Function 2: EXT3 ;Used Pull up
        SFSP2_6 = (1<<2)|(1<<3);        //use intern pullup

        ER_INT_CLR = 0x3FFFFFF;  // Clear all Interrupt-Flags
        ER_MASK_CLR = 0x3FFFFFF; //Clear all masks

        install_irq( EVT_INT, (void *)EXT_INT_3_Handler, 0x0A );
        EnableIntReq_IRQ( EVT_INT, ACTIVE_LOW, 0x0A );
        ER_MASK_SET |= (1<<3);  //activate EXT_Int 3


        regVal = ER_PEND;
        mu=ER_APR;
        du=ER_MASK_SET;
        er=ER_MASK_CLR;



        flag.ascii=1;
        return;
}

if i read the variables "du,er" during debugging, they are allways! 0... So he jumps into the ISR but not because of my interrupt, its because of another interrupt, which is activated allthough they should be disabled...
The other Register i can write normal, and read the values in the Debugger...
If i use the FIQ interrupt he stucks all the time in the "Fiq branch handler", dont know what it is...
Is there a rule when i can write on the Registers or sth? Didnt find anything and i really dont know how to go on now.

Thx in advance for ur help!

Manuel