+ Post New Thread
Results 1 to 5 of 5
  1. #1
    Junior Member level 2
    Points: 691, Level: 5

    Join Date
    Mar 2010
    Location
    India
    Posts
    20
    Helped
    1 / 1
    Points
    691
    Level
    5

    24c04 eeprom's writing/reading

    I wrote a simple program to write and read 0x99 to address 0x0077 of 24c04 but the simulation does'nt read the value 0x99 from that address instead it reads 0x77 from 0x0077.

    In the proteus file i changed the serial eeprom with 24c32, 24c64, 24c128 and 24c256 and it worked fine and written and read the value 0x99 to/from address 0x0077 successfully. But with 24c04 this does'nt work. Please suggest some solution or rectify the problem.

    The Proteus Simulation is attached.

    Thanks

    •   Alt17th June 2010, 18:29

      advertising

        
       

  2. #2
    Newbie level 4
    Points: 496, Level: 4

    Join Date
    Jun 2010
    Location
    brazil
    Posts
    7
    Helped
    3 / 3
    Points
    496
    Level
    4

    Re: 24c04 eeprom's writing/reading

    I think 24c04 and 24c32, 24c64, 24c128 have diffr. block address


    1 members found this post helpful.

    •   Alt18th June 2010, 14:16

      advertising

        
       

  3. #3
    Advanced Member level 2
    Points: 5,582, Level: 17
    Kurenai_ryu's Avatar
    Join Date
    Jun 2006
    Location
    Bolivia
    Posts
    571
    Helped
    127 / 127
    Points
    5,582
    Level
    17

    24c04 eeprom's writing/reading

    for 24c01 to 24c16 (including 24c04) you have only 1 byte for addressing... (works fine with 24c01 and 24c02) for extra addressing you must use the 3 lower bits of I2c-address

    so you must chage your writing/readings routines...
    {the extra stuff over 0xA0 to the 3bit extra addressing... }
    Code:
    unsigned char ReadBYTE(unsigned int Addr)
    {
       	unsigned char Data;
    	Start();
    	WriteI2C(0xA0 | ((Addr>>7)&0x0E));
    	
    	WriteI2C((unsigned char)Addr&0xFF);
    	
    	Start();
    	
    	WriteI2C(0xA1);
    	Data = ReadI2C();
    	
    	Stop();
       	return(Data);
    }
    
    
    void WriteBYTE(unsigned int Addr,unsigned char Data)
    {
    	Start();
    
    	WriteI2C(0xA0  | ((Addr>>7)&0x0E));
    	
    	WriteI2C((unsigned char)Addr&0xFF);			// send address low	
    
    	WriteI2C(Data);
    	Stop();	
    }


    4 members found this post helpful.

    •   Alt18th June 2010, 22:14

      advertising

        
       

  4. #4
    Junior Member level 2
    Points: 691, Level: 5

    Join Date
    Mar 2010
    Location
    India
    Posts
    20
    Helped
    1 / 1
    Points
    691
    Level
    5

    Re: 24c04 eeprom's writing/reading

    Thanks a lot. It has worked now.


    1 members found this post helpful.

  5. #5
    Newbie level 2
    Points: 510, Level: 4

    Join Date
    Feb 2010
    Location
    punjab
    Posts
    2
    Helped
    0 / 0
    Points
    510
    Level
    4

    Re: 24c04 eeprom's writing/reading

    i am using eeprom 24c08, i wanto to store an many strings into eeprom one string is of 4 bytes. but i dont know how to put it in eeprom. can anyone send me the code for 8051 (keil) or PIC (using MIKROC) in C language.....the string is of having 1000 each of 4 bytes. plz send me the code....
    thankyou...
    email id: ashu_aka88@yahoo.com



+ Post New Thread
Please login