The i2c specification from Philips specifies that the two lines SCL and SDA be driven from open collector outputs. These outputs then need to have pullup resistors to +Vdd. In order to send a 1 on the bus the driver allows the data line to float high. To send a zero, the driver will drive the data line low. Since the PIC parts do not usually have open collector outputs, the only thing to do is to use the TRIS registers and change the direction of the port. If the proper pullups are installed on the bus lines, the result will be an i2c bus. The PIC data sheets for the parts that have a hardware SCI port also have a reasonable description of the I2C bus protocol. For more information, get the application note "The I2C bus and how to use it" >from www.philips.com at Philips Semiconductor. ---------- From: Giorgio Alboni[SMTP:rac1337@PROVINCIA.RA.IT] Reply To: pic microcontroller discussion list Sent: Monday, September 08, 1997 4:44 AM To: PICLIST@MITVMA.MIT.EDU Subject: an554 I'm try to use the i2c_los.asm ruotine of the an554. For me there are some big error: ;*************************************************************************** ****************************** ; Send Start Bit ; ;*************************************************************************** ****************************** TxmtStartBit: bsf STATUS,RP0 ; select page 1 bsf _SDA ; set SDA high bsf _SCL ; clock is high Why the TxmtStartBit set page1 for access _SDA bit (PORTA or PORTB) instead page0? In this way the program change the TRISA or TRISB bit instead of PORTA or PORTB bit. This broblem is repeat in all teh i2c_low.asm file. Is it an error? Thanks in Advance. =================================================== Alboni Giorgio Faenza (Ra) ITALY E-Mail: rac1337@racine.ravenna.it http://www.geocities.com/SiliconValley/Heights/5444 (Last Update: 19/06/97) ===================================================