Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/11/06 11:51
Read: times


 
#129278 - Photo
Responding to: ???'s previous message
EEPROM increases internal add. pointer automaticlly when a data was written. In the code (relevant code is below) it is possible to write 'F0H' data to add. location 10H. In the EEPROM_WRITE sub routine the code works. when I wanted to read this data back, the data on the 11H add. location is being sent back. Why I can not specify the 10H location to the EEPROM again?.

EEPROM_WRITE:
	LCALL I2C_START
	LCALL EE_ADD_WR
	MOV A,DPL           ;DPL is 10H
	LCALL I2C_WRITE
	LCALL ACK
	MOV A,VERI          ;VERI is 30H add. location in the ram
	LCALL I2C_WRITE
	LCALL ACK
	LCALL I2C_STOP
	RET
EEPROM_READ:
	LCALL I2C_START
	LCALL EE_ADD_WR
	MOV A,DPL
	LCALL I2C_WRITE
	LCALL ACK
	LCALL I2C_START
	LCALL EE_ADD_RD
	LCALL I2C_READ
	LCALL NO_ACK
	LCALL I2C_STOP
	RET

EE_ADD_WR:
	MOV A,#0A0H
	LCALL I2C_WRITE
	LCALL ACK
	RET
EE_ADD_RD:
	MOV A,#0A1H
	LCALL I2C_WRITE
	LCALL ACK
	RET

I2C_WRITE:
	MOV R7,#8D
	CLR C
LOOP:	RLC A
	MOV SDA,C
	LCALL CLOCK
	DJNZ R7,LOOP
	RET
I2C_READ:
	MOV R7,#8D
LOOP2:	SETB SDA
	SETB SCL
	NOP
	NOP
	MOV C,SDA
	RLC A
	CLR SCL
	NOP
	NOP
	DJNZ R7,LOOP2
	MOV VERI,A
	RET





List of 14 messages in thread
TopicAuthorDate
I2C Read Operation            01/01/70 00:00      
   Photo            01/01/70 00:00      
      get the real stuff            01/01/70 00:00      
         I agree and, in addition            01/01/70 00:00      
            Thanks for all Replies, But...            01/01/70 00:00      
               By the way...            01/01/70 00:00      
                DELAY time is required ,I guess            01/01/70 00:00      
                  EEPROM needs time to write            01/01/70 00:00      
               what is it you do not understand            01/01/70 00:00      
                  what is it you do not understand            01/01/70 00:00      
                     I will not            01/01/70 00:00      
                        True            01/01/70 00:00      
   simulator            01/01/70 00:00      
   What addressing you are using            01/01/70 00:00      

Back to Subject List