EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / How to wrie 16-bit data EEPROM 24c021

How to wrie 16-bit data EEPROM 24c021

|

Microcontroller › 8051 › How to wrie 16-bit data EEPROM 24c021

  • This topic has 2 replies, 2 voices, and was last updated 14 years ago by amardeep.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • February 28, 2012 at 4:40 pm #1622
    amardeep
    Participant

    Hi ..
     

    I am using 24c02 EEPROM memory for data storage .

    i am working on a project of counter. i use Unsigned int variable who value is increment and maximum value is 65535 
     

    i need help or algorithm how to write this 16-bit value into EEPROM

    March 7, 2012 at 10:21 am #7271
    nikhiljain
    Participant

    Break the data into two one byte numbers using masking and send one byte at a time to the eeprom. However in the logic of your program you have to convert the two bytes into one number.

    March 7, 2012 at 1:18 pm #7276
    amardeep
    Participant

    hi ..
     

     

    by this way :

     

     

     

       unsigned int data,addtion,add ;

       unsigned char upper,lower;

     

    /* write operation*/

       lower = data%100;  // lower byte
       upper = data/100;  // upper byte  
     
     
    /* read operation*/
     
       addtion = lower;
       add = upper<<8;
       add = add | addtion;
       
       i write eeprom by this way …but when i perform read operation the value will changed ..
       but result is changed …
      for that what i have to do ..??  
  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • cpap change over circuit March 14, 2026
  • Fender rumble 100 base amp, power, light and overdrive light flash repeatedly when power turned on no output March 13, 2026
  • Phone to op amp circuit? March 13, 2026
  • Arduino standalone minimal March 13, 2026
  • Project boxes March 13, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise