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 / 8051 to EEPROM 24LC64 –Stuck at second “Start” while read-ing

8051 to EEPROM 24LC64 –Stuck at second “Start” while read-ing

|

Microcontroller › 8051 › 8051 to EEPROM 24LC64 –Stuck at second “Start” while read-ing

  • This topic has 1 reply, 2 voices, and was last updated 14 years, 10 months ago by dagakshay.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • April 19, 2011 at 5:33 am #870
    Nikolai Urdinov
    Participant

    ;            SDA =P1.0
    ;            SCL =P1.1

    ;*****************************************************
    ;  READ PROCESS
    ;*****************************************************
        LCALL    START

        MOV    A,#0A0H
        LCALL    WRITE

        LCALL    DELAY
        LCALL    DELAY

        MOV    A,#00H    ;ADDRESS HI
        LCALL    WRITE    

        MOV    A,#00H    ;ADDRESS LO
        LCALL    WRITE    

        LCALL    DELAY
        LCALL    DELAY

        LCALL    START
       ; MOV    P0,#11111010B
        MOV    A,#10100001B
        LCALL    WRITE                                         ;program stuck at here, no ack was returned.

        MOV    P0,#11111110B

        LCALL    READ
        LCALL    STOP
    ;*****************************************************
    ;  
    ;*****************************************************
    LOOPS    NOP
        LJMP    LOOPS

    ;*****************************************************
    ;  INITIAL PART
    ;*****************************************************
    START    SETB    P1.0    ;SCA ;DATA
        NOP
        SETB    P1.1
        NOP
        NOP
        NOP
        NOP
        NOP
        CLR    P1.0
        NOP
        NOP
        NOP
        NOP
        NOP
        CLR    P1.1
        RET

    ;*****************************************************
    ;  WRITE BYTE
    ;*****************************************************
    WRITE    MOV    R2,#08H
    WRBIT    CLR    P1.1    ;CLK LOW
        NOP
        NOP
        RLC    A
        MOV    P1.0,C
        NOP
        NOP
        SETB    P1.1    ;CLK HI
        NOP
        NOP
        DJNZ    R2,WRBIT
        CLR    P1.1    ;ACK CLK LO
        NOP
        NOP
        SETB    P1.1    ;ACK CLK HI
        NOP
        NOP
    LOOP    JNB    P1.0,EXIT
        AJMP    LOOP
    EXIT    MOV    P0,#00001111B
        CLR    P1.1    ;RETURN ACK CLK LO
        RET
    ;*****************************************************
    ;  READ BYTE
    ;*****************************************************
    READ    MOV    R2,#08H
    RDBIT    CLR    P1.1    ;CLK LO
        NOP
        NOP
        SETB    P1.1    ;CLK HI
        NOP
        NOP
        MOV    C,P1.0
        NOP
        NOP
        RLC    A
        DJNZ    R2,RDBIT
        CLR    C
        CLR    P1.1
        NOP
        NOP
        CLR    P1.0    ;DATA LO
        NOP
        NOP
        SETB    P1.1    ;CLK HI
        NOP
        NOP
        CLR    P1.1    ;CLK LO
        NOP
        NOP
        SETB    P1.0
        MOV    P0,A
        RET
    ;*****************************************************
    ;  STOP
    ;*****************************************************
    STOP    CLR    P1.0
        NOP
        NOP
        NOP
        NOP
        NOP
        SETB    P1.1
        NOP
        NOP
        NOP
        NOP
        NOP
        SETB    P1.0
        NOP
        NOP
        NOP
        NOP
        RET
    ;*****************************************************
    ;  DELAY
    ;*****************************************************
    DELAY    MOV    R6,#255
    DL1    MOV    R7,#255
    DL2    DJNZ    R7,DL2
        DJNZ    R6,DL1
        RET
    ;*****************************************************
    ;  
    ;*****************************************************
        END

     

    April 20, 2011 at 2:05 pm #6010
    dagakshay
    Participant

    http://www.engineersgarage.com/microcontroller/8051projects/interface-serial-eeprom-24c02-AT89C51-circuit

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • RC Electronic Speed Control Capacitors February 16, 2026
  • CR2/CR123A Batteries In Projects February 16, 2026
  • Harman Kardon radio module BMW noise February 16, 2026
  • analog logic of shmidt trigger bjt circuit February 16, 2026
  • Arduino standalone minimal February 16, 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