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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/19/09 16:15
Read: times


 
#168982 - The CODE is here,please guide
Responding to: ???'s previous message
Yes only Atmel AT24C02 datasheet tell me that, not others! Datasheet like NM24C02 from FAIRCHILD, 24C02SC from MICROCHIP, IS24C02 from ISSI, do not talk about memory reset.
I have not seen any code for I2C, including this site's code library, that contains code for memory reset. I as a beginner do think that memory reset of I2C device is mandatory in bus master's firmware as a precautionary measure, even if datasheets do not mention it.
Therefore the code I wrote is as follows should be inserted in the system initialization area of the bus master's firmware
Please guide if the code is alright
It is assumed that an AT89C51 is running at 12Mhz and SCL is 100 Khz,
I2CRESET:setb	SCL
	 setb	SDA
	 acall	DELAY	; a DELAY for 5 uS inserted
	 clr	SDA	;Start condition
	 acall	DELAY
	 clr	SCL
	 nop
	 setb	SDA	;SDA raised
	 mov	r5,#9
	 acall	DELAY
NINE:	 setb	SCL	;9 (NINE) clocks applied
	 acall	DELAY
	 clr	SCL
	 nop
	 nop
	 nop
	 djnz	r5,NINE 
	 setb	SCL
	 acall	DELAY
	 clr	SDA	;Start condition
	 acall	DELAY
	 clr	SCL
	 acall	DELAY
	 setb	SCL 
	 acall	DELAY
	 setb	SDA	;Stop condition

DELAY:    nop
          ret
 



List of 12 messages in thread
TopicAuthorDate
I2C memory reset            01/01/70 00:00      
   What does the Datasheet tell you            01/01/70 00:00      
      The CODE is here,please guide            01/01/70 00:00      
         What, exactly, did the datasheet tell you?            01/01/70 00:00      
            Link to the Datasheet is here ....            01/01/70 00:00      
               So what is you question?            01/01/70 00:00      
                  So the QUESTION is ....            01/01/70 00:00      
                     Bus reset to get I2C listeners back to "idle"            01/01/70 00:00      
                        Thanks to Westermark            01/01/70 00:00      
   adhere to the datasheet of the one you're using            01/01/70 00:00      
      Who don't know this !            01/01/70 00:00      
         you're being encouraged to do your own thinking            01/01/70 00:00      

Back to Subject List