Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/20/08 03:50
Read: times


 
#156058 - Interrupt arbitration hardware issue/question
Now that I have a fully functional I2C hardware master and slave combination, I'm almost done coding the slave functionality. NXP P89LPC924

My original design uses the hardware SDA and SCL for the I2C. My project watches for a critical timed event to create a one shot with a control pulse length that is repetitive on a falling edge. I tied that input to INT1 since INT0 is in use for the I2C hardware. The problem i've run into is that the arbitration is number 7 for INT1 and I2C is number 5 which is higher priority. So when I toggle the INT1 pin, it never goes to the ISR vector 0013h as it should.......ever.

I've run a seperate standalone test to ensure I am setting the ISR's properly and put some sample code with a break point there to see if it actually see the pin toggle.....and for both INT0 and INT1 in a test mode work exactly as expected. When I apply the INT1 to my functional project.....it never breaks.....and I know its because its losing arbitration during the I2C transfer when the toggle comes in. I thought when the I2C transfer finishes after the NACK last byte, it should jump and finish the ISR routine....it never does.

If I switch over and use INT0 of course it works exactly as it should breaks in the middle of the I2C transfer and then resumes when the ISR routine is complete. The interrupt shows the interrupt INT1 enabled just as INT0 and the assembly code also shows the compiled ISR code at vector 0013h.

I have to use the hardware I2C so INT0 is out of the question. So I'm stuck with INT1 which is already hardwired. The incoming signal can not exist on the INT0 input since it will corrupt any I2C communication obviously.

So knowing all this, anyone have a suggestion on how to get INT1 to work properly?

Here is the code I'm using for reference
void ex1_isr (void) interrupt 2
{
P0=0x01;
P0=0x02;
P0=0x03;
P0=0x04;
P0=0x05;
P0=0x06;
}

void Boot_Delay (void) //Forced delay to allow HC_VGA initialization
{

unsigned long Delaycounter;
for (Delaycounter = 0; Delaycounter <=1725; Delaycounter ++)      {                                                        
    Wait(1);//wait 1 ms
    }
}

void main (void)//main program
{

IT1 = 1;   // Configure interrupt 0 for falling edge on /INT1 (P1.4)
EX1 = 1;   // Enable EX1 Interrupt
EA = 1;    // Enable Global Interrupt Flag

//Boot_Delay();

while(1)//Loop this section forever
   {    
   i2c_init(0x00, 0);  //Sets the address and General Call
   i2c_receive(0x00); //Address of Slave device to send to   
   while (i2c_getstatus() & I2C_BUSY);	// wait until complete
   DriverSelection();
   }
}



List of 5 messages in thread
TopicAuthorDate
Interrupt arbitration hardware issue/question            01/01/70 00:00      
   ??? and a misunderstanding            01/01/70 00:00      
      Ok, I do recall, but            01/01/70 00:00      
         Never Mind I figured it out            01/01/70 00:00      
         when in doubt, leave the pins in quasi            01/01/70 00:00      

Back to Subject List