Hello all,
I am new to Dynamic C and using a rabbit 3000 board. I am enabling external interrupts PE4 and PE0. I then try to read the bit in the interrupt service routine to see which one was triggered. However PEDR just always reads what it was in board init (0xE7). Should it change? What am I doing worng?
//board int
WrPortI(PECR, &PECRShadow, PECRShadow&0x00); //clear all bits to pclk/2
WrPortI(PEFR, &PEFRShadow, PECRShadow&0x00); //clear all bits to normal function
WrPortI(PEDR, &PEDRShadow,0xE7); //set bits 7,6,5,2,1,0 output high and
//set bits 4,3 output low
WrPortI(PEDDR, &PEDDRShadow, PEDDRShadow|0xFB); //set bits 7,6,5,4,3,2,1,0 to output
//set isr handler
SetVectExtern3000(0, &buttonPress_isr_S2);
SetVectExtern3000(1, &buttonPress_isr_S3);
//enable interrupt
WrPortI(I0CR, &I0CRShadow, 0x0D); // enable external INT0
//PG1 shorted to PE0,
//button S2 hrs
//falling edge,
debug root interrupt void buttonPress_isr_S2()
{
int ilocal;
ilocal= RdPortI(PEDR); //shouldn’t this tell me what edge trigger?