serial eeprom interfacing at24c08 with at89c2051


Posted on Feb 6, 2014

Microchip has addressed this need with a full line of serial EEPROMs, in a variety of memory configurations, using the industry-standard 2- or 3-wire communication protocols. SDA1 EQU P1. 1 ;SDA=PIN5 SCL1 EQU P1. 0 ;SCL=PIN6 WTCMD EQU 10100000B ;WRITE DATA COMMAND RDCMD EQU 10100001B ;READ DATA COMMAND ; STORE A BYTE IN EEPROM


serial eeprom interfacing at24c08 with at89c2051
Click here to download the full size of the above Circuit.

(Data 8F in address location 2AH) ; MOV A, #WTCMD ;LOAD WRITE COMMAND CALL OUTS ;SEND IT MOV A, #2AH ;GET BYTE ADDRESS CALL OUT ;SEND IT MOV A, #8FH ;GET DATA CALL OUT ;SEND IT CALL STOP ;SEND STOP CONDITION ; READ A BYTE FROM EEPROM FROM ADDRESS LOCATION 4DH ; MOV A, #WTCMD ;LOAD WRITE COMMAND TO SEND ADDRESS CALL OUTS ;SEND IT MOV A, #4DH ;GET LOW BYTE ADDRESS CALL OUT ;SEND IT CALL CREAD ;GET DATA BYTE MOV A, R1 CALL MDELAY RET ;* ; EEPROM ROUTINES ;* ;* ; THIS ROUTINE SENDS OUT CONTENTS OF THE ACCUMULATOR ; to the EEPROM and includes START condition. Refer to the data sheets ; for discussion of START and STOP conditions. ;* OUTS: MOV R2, #8 ;LOOP COUNT - EQUAL TO BIT COUNT SETB SDA1 ;INSURE DATA IS HI SETB SCL1 ;INSURE CLOCK IS HI NOP ;NOTE 1 NOP NOP CLR SDA1 ;START CONDITION - DATA = 0 NOP ;NOTE 1 NOP NOP CLR SCL1 ;CLOCK = 0 OTSLP: RLC A ;SHIFT BIT JNC BITLS SETB SDA1 ;DATA = 1 JMP OTSL1 ;CONTINUE BITLS: CLR SDA1 ;DATA = 0 OTSL1: SETB SCL1 ;CLOCK HI NOP ;NOTE 1 NOP NOP CLR SCL1 ;CLOCK LOW DJNZ R2, OTSLP ;DECREMENT COUNTER SETB SDA1 ;TURN PIN INTO INPUT NOP ;NOTE 1 SETB SCL1 ;CLOCK ACK NOP ;NOTE 1 NOP NOP CLR SCL1 RET ;* ; THIS ROUTINE SENDS OUT CONTENTS OF ACCUMLATOR TO EEPROM ; without sending a START condition. ;* OUT: MOV R2, #8 ;LOOP COUNT - EQUAL TO BIT COUNT OTLP: RLC A ;SHIFT BIT JNC BITL SETB SDA1 ;DATA = 1 JMP OTL1 ;CONTINUE BITL: CLR SDA1 ;DATA = 0 OTL1: SETB SCL1 ;CLOCK HI NOP ;NOTE 1 NOP NOP CLR SCL1 ;CLOCK...




Leave Comment

characters left:

Related Circuits

  • New Circuits

    .

     


    Popular Circuits

    NiCad charger with independent discharge
    Multiplying pulse widths circuit
    Personal-pocket-pager
    power supply How do I select the accompanying components for an optocoupler
    voltage How to amplify 3.3 volts to 8-9v
    150 watt amplifier circuit
    regulator
    Blochead Diamond Buffer
    Smoke Alarm Battery Life Extender
    Upgrade your RC Transmitter with a DIY Tilt Motion Control Module
    BIQUAD AUDIO FILTER



    Top