Hi, I'm fiddling about with I2C for the first time, so please feel free to point out any errors or pitfalls I should watch out for. I understand that after a START condition has been initiated, the SSPIF flag should be raised in PIR1, but it's not happening for me. The code I'm using is below - basically, I call INIT_I2C, followed by START_I2C. The latter never returns because WAIT_I2C doesn't get past its internal loop. What's wrong? Thanks, Kieran -- INIT_I2C MOVLW 0x28 ; Select I2C Master Mode MOVWF SSPCON BSF STATUS, RP0 ; Select bank 1 CLRF SSPCON2 BCF SSPSTAT, SMP ; Set slew rate and I2C levels BCF SSPSTAT, CKE MOVLW 0x3F ; Bits 6 to 0 are loaded into the baud rate MOVWF SSPADD ; generator - max value is 63 (3F) - gives ; 300k clock at 20MHz BCF STATUS, RP0 ; Select bank 0 RETURN START_I2C BSF STATUS, RP0 ; Select bank 1 BSF SSPCON2, SEN ; Initiate START condition BCF STATUS, RP0 ; Select bank 0 CALL WAIT_I2C ; Wait for START condition to complete RETURN WAIT_I2C BTFSS PIR1, SSPIF ; Wait for the SSPIF flag to appear GOTO WAIT_I2C BCF PIR1, SSPIF ; Clear the interrupt and continue RETURN -- Visit The Northern Ireland Macintosh User Group http://welcome.to/nimug Send SMS messages via email: kmiller@sms.genie.co.uk Fax: +44-(0)870-131-9044 -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics