Hi everyone, It's 2 years now that i'am read the list and now i'am trying my first "real" project. It's based on 16f876: The working part: Seriale interface 232 using interrupts Modubus protocol func. 1 to 6 using interrupts Magnetic Card Reader using interrupts I2C routine for RTC and ext EEprom using polling My perplesity is that a polling routine can get stuck in the middle and never return to the main cycle. I tried doing I2C with interrupts on PIR1, SSPIF but it seems to me that I never can clear it. I tryed a couple of weeks and then gave up. The real question is does peolple ("programmers") use polling or interrupts for I2C. Any help ? ; ***** Routine x pulire SSPIF ********************************************** clear_sspif bcf PIR1, Bit3 ; SSPIF btfsc PIR1, Bit3 ; SSPIF goto clear_sspif return ; ***** Routine x cercare SSPIF alto **************************************** poll_sspif btfss PIR1, Bit3 goto poll_sspif return ; ***** Start routine per iniziare TX o RX del I2C start_i2c bsf PORTC, Bit3 bsf PORTC, Bit4 go_bank1 bsf SSPCON2, SEN go_bank0 return stop_i2c go_bank1 bsf SSPCON2, PEN go_bank0 return recieve_i2c go_bank1 bsf SSPCON2, RCEN go_bank0 return master_ACK go_bank1 bcf SSPCON2, ACKDT bsf SSPCON2, ACKEN go_bank0 return master_NOT_ACK go_bank1 bsf SSPCON2, ACKDT bsf SSPCON2, ACKEN go_bank0 return -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu