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 13 years, 8 months 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

  • WTB: "The Theory Of Servicing AM, FM, And FM Receivers" by Clarence R. Green and Robert M. Bourque November 7, 2025
  • Converting 1vac to 24vac November 7, 2025
  • AC Input Relay Device Required November 7, 2025
  • MLT-8530 Buzzer on ESP32: Why Is the Sound Output Lower Than Expected? November 6, 2025
  • Scope Clock CRT Z-Axis - Grid bias positive? November 6, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 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