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

    General use Preamplifier with 2N3904
    Tandem dimmer
    Scope-sensitivity-amplifier
    Dual-tracking-regulator
    Speakerphone Adapter Circuit
    op amp Amplifying signal from CO2 Sensor
    pwm with microcontroller 8051 for scr
    Super Light Sensor
    UHF amplifier circuit
    SINGLE CHIP DIGITAL VOLTMETER
    Key Code Combination High Security Door Lock



    Top