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 / Internal EEPROM.

Internal EEPROM.

|

Microcontroller › 8051 › Internal EEPROM.

  • This topic has 0 replies, 1 voice, and was last updated 11 years, 5 months ago by Nexus.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • July 9, 2014 at 6:13 am #3142
    Nexus
    Participant
    Hi. I’m currently doing an project with AT89S8352 microcontroller with Assembly language. I have learnt it and done some very simple code, up to this point however. I have tried to read and understand the internal EEPROM in the micro-controller, however I am not able to write a successful code to compile and see it working on a virtual simulation program (Proteus 8). I really would like your help to help me understand how to make a code to read and write into the internal EEPROM of the AT89S8352. This is what I have coded so far.
     
     
    EECON DATA 96H ; watchdog and memory control register
    EEMEN EQU 00001000B ; EEPROM access enable bit
    EEMWE EQU 00010000B ; EEPROM write enable bit
    EELD EQU 00100000B ; EEPROM page load enable bit
    WRTINH EQU 00000001B ; EEPROM WRTINH bit
    RDY EQU 00000010B ; EEPROM RDY/BSY bit
     
    Read:
    orl EECON, #EEMEN ; enable EEPROM accesses
    mov dptr, #ADDRESS ; address to read
    movx a, @dptr ; read EEPROM
    xrl EECON, #EEMEN ; disable EEPROM accesses
     
    Write:
    orl EECON, #EEMEN ; enable EEPROM accesses
    orl EECON, #EEMWE ; enable EEPROM writes
    mov a, EECON ; get EEPROM status
    anl a, #WRTINH ; check WRTINH
    jz ERROR ; jump if inhibited
    mov dptr, #ADDRESS ; address to write
    mov a, #DATA ; data to write
    movx @dptr, a ; write EEPROM
    call DELAY_10_MS ; wait 10 ms
    movx a, @dptr ; read EEPROM
    cjne a, #DATA, ERROR; jump if data compare fails
    xrl EECON, #EEMWE ; disable EEPROM writes
    xrl EECON, #EEMEN ; disable EEPROM accesses
     
     
    My question is, what is the ADDRESS in the Read code? Is the address meant for the micro-controller or EEPROM? If it’s meant for the EEPROM, what other addresses are there?
     
    Is the ADDRESS in Read and Write the same address? If, they are different addresses, what are they?
     
    What is the DATA ? What kind of data can be written? Would like an example of all possible data please.
  • Author
    Posts
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • Hitachi SuperScan Elite 802 CRT Monitor Issues (Model CM802U) December 7, 2025
  • Sanity Check – Peltier "Cooler" for Heating and Cooling December 7, 2025
  • My Advanced Realistic Humanoid Robots Project December 7, 2025
  • Funny Images Thread! December 7, 2025
  • I am ready to move from electrical and electronics field but confused where ? December 7, 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