I am sorry for increasing thje noise / entropy level of this nice list. Actaully, I am feeling stuck up, that is why I am bothering you people once again. After doing some more reading from every where, I changed my code to the one pasted below, but still I am no where... Can any body correct me Pls... #include <16f84.h> #define EEPROM_SCL PIN_A0 #define EEPROM_SDA PIN_A1 #use i2c(master,sda=EEPROM_SDA, scl=EEPROM_SCL) #define EEPROM_ADDRESS byte #define EEPROM_SIZE 256 //EEPROM = 24LC00, it can be any model. // Configure PIC to use: XT clock, no code protection // Disable Power Up Timer, no Watchdog Timer, #fuses XT, NOPROTECT, NOPUT, NOWDT // tell compiler clock is 4MHz. This is required for DELAY_MS() // and for serial I/O, all of which use software delay loops. #use delay (clock=4000000) // declare that we'll manually establish the data direction of // each I/O pin on ports A&B. #use fast_io ( a ) #use fast_io ( b ) #byte PORT_A = 5 /* set variable that maps to memory */ #byte PORT_B = 6 /* set variable that maps to memory */ void init_ext_eeprom(void) { output_low(eeprom_scl); output_high(eeprom_sda); } void write_ext_eeprom(byte address, byte data) { i2c_start(); i2c_write(0xa0); PORT_B=0; // to debug, program never execyte this statemen. i2c_write(address); i2c_write(data); i2c_stop(); delay_ms(11); } byte read_ext_eeprom(byte address) { byte data; i2c_start(); i2c_write(0xa0); i2c_write(address); i2c_start(); i2c_write(0xa1); data=i2c_read(0); i2c_stop(); return(data); } void main(void) { byte data; set_tris_a (0b00000000); /* set up I/O's */ set_tris_b (0b00000000); /* set up I/O's */ PORT_A=0; PORT_B=0; init_ext_eeprom(); while(1) { data=0xff; //just to debug PORT_B=data; delay_ms(500); write_ext_eeprom(5,data); PORT_B=0; //just to debug data= read_ext_eeprom(5); PORT_B=data; delay_ms(500); } } In the while loop of main, I am trying to use portb for debug purposes. Before write_ext_eeprom(5,data);, every thing goes fine but it seems that in this function, the program gets hooked up and does nothing further. Adam --------------------------------- Ahhh...imagining that irresistible "new car" smell? Check outnew cars at Yahoo! Autos. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist