> Van: Radboud Verberne > Aan: PICLIST@MITVMA.MIT.EDU > Onderwerp: PIC Interfacing Serial EEPROM > Datum: maandag 14 september 1998 15:16 > > Hello Everybody, > > I'm busy with a project to operate a old Nokia MD 59 ATF2 telepfone on the > 70cm band (430-440Mhz). I want to use a EEPROM to store some data on it. > (last used frequency, shift, ctcss etc.) On the Internet I found a piece of > code for a 16c84 written in C (in the POST card from Plamen Vaysilov). When > I was tranlating I saw that he never looked if the slave (24c65 in his > case) acknowledged the i2c signals. Plamen Vaysilov is also NOT using > pull-up resistors!? > > Could this be a problem? I think he uses the internal (weak) pull-ups for port B ... > I thought that you had to use some pull-up resistors (2k2 at 400Khz, 10k at > 100Khz) and then put the SDA into High impedance to output a logic "1" and > configuring the SDA line as an Output with the output set to zero for a > logic "0". > > What is the best method? Only configure the SDA as an input when nessarly > or always as an input when a Logical "1" is needed? Use the second. That way the slave _can_ pull the line down whenever he wants, without creating a short. Please use this method for _both_ lines (you never know). > Please send me a personal message because i'm not subscribed to the PIC list. > > > Well this is my translated version... > > ;************************************************************************* > ; I2C Routines > ;************************************************************************* > i2cdelay > nop > nop > nop > nop > nop > nop > return You could use a "Goto $+1" to replace 2 NOP's ... A CALL to the RETURN statement uses 4 cycles, but uses one stack ... Greetz, Rudy Wieser Nijmegen, the Netherlands !