| Details |
Message |
|
Read-Only
Author javad majd
Posted 30-Jan-2003 08:49 GMT
Toolset C51
|
 24c04 Read & Write
javad majd
Hi,
I am looking for simple read and write routines for I2C interface between Atmel low-end 89C55 microcontroller and 24C04 serial EEPROM.(esp. assembly code)
Any help would be great .
Thanks in Advance.
|
|
|
Read-Only
Author erik malund
Posted 30-Jan-2003 12:39 GMT
Toolset C51
|
 RE: 24c04 Read & Write
erik malund
Check Philips appnotes, all you want (and more)
Erik
|
|
|
Read-Only
Author emmad hassan
Posted 23-Sep-2003 16:05 GMT
Toolset C51
|
 RE: 24c04 Read & Write
emmad hassan
hi,i have contacted u as i need help i am interfacing 24c04 to 89c52 microcontroller as an external ram can u help me in it.i will be thankful to u.
emmad_satti@hotmail.com
|
|
|
Read-Only
Author emmad hassan
Posted 23-Sep-2003 16:06 GMT
Toolset C51
|
 RE: 24c04 Read & Write
emmad hassan
hi,i have contacted u as i need help i am interfacing 24c04 to 89c52 microcontroller as an external ram can u help me in it.i will be thankful to u.
emmad_satti@hotmail.com
|
|
|
Read-Only
Author Stefan Duncanson
Posted 23-Sep-2003 17:04 GMT
Toolset C51
|
 RE: 24c04 Read & Write
Stefan Duncanson
What exactly is your problem?
Stefan
|
|
|
Read-Only
Author Andrew Neil
Posted 23-Sep-2003 17:47 GMT
Toolset C51
|
 RE: 24c04 Read & Write
Andrew Neil
Have you followed Erik's advice?
|
|
|
Read-Only
Author Raj Shetgar
Posted 24-Sep-2003 04:56 GMT
Toolset C51
|
 RE: 24c04 Read & Write
Raj Shetgar
If you are interested in improving your knowledge follow what others have mentioned above...but if you just need the code...
;RAM LOCATION USED IN THIS MODULE 70H
;THIS IS A WORKING PROGRAM, TESTED ON 24C04 SERIAL MEMORY IC
;THE SAME CODE CAN BE USED FOR OTHER I2C IC'S WITH MODIFICATION.
WTCMD EQU 10100000B ;24C04 WRITE COMMAND
RDCMD EQU 10100001B ;24C04 READ COMMAND
ADDRS EQU 70H
SCL EQU P3.6 ;SERIAL CLOCK PIN
SDA EQU P3.7 ;SERIAL DATA PIN
ORG 0000H
LJMP START
ORG 0030H
START:
MOV P1,#01H
MOV R1,#55H ;
MOV A,#00 ;WRITE THE DATA IN R1 REGISTER INTO
MOV ADDRS,A ;ADDRESS POINTED BY ADDRS INTO TEH 24C04
LCALL WRITE ;
LCALL L_DELAY
MOV A,#00 ;
MOV ADDRS,A ;READ THE DATA FROM 24C04 FROM THE MEMORY
LCALL READ ;LOCATION POINTED BY ADDRS AND STORE IN R2
MOV A,R2 ;
MOV P1,A ;MOVE THE RED BACK DATA ONTO P0
LCALL L_DELAY
LJMP START
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;THIS IS USED TO WRITE INTO 24C04
;ARGUMENTS1 --> ADDRS => ADDRESS TO BE WRITTEN INTO,IN 24C04 MEMORY
;ARGUMENTS2 --> R1 ==> DATA TO BE WRITTEN
;RETURN --> NONE
WRITE:
MOV A,#WTCMD
CALL OUTS
MOV A,ADDRS
CALL OUT
MOV A,R1
CALL OUT
CALL STOP
RET
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;THIS SUB ROUTINE IS USED TO READ DATA FROM THE 24C04
;ARGUMENTS --> ADDRS ==> ADDRESS IN 24C04,THE DATA SHOULD BE READ FROM.
;RETURN --> R2(DATA THAT WAS READ)
READ:
MOV A,#WTCMD
CALL OUTS
MOV A,ADDRS
LCALL OUT
MOV A,#RDCMD
LCALL OUTS
LCALL IN
MOV R2,A
LCALL STOP
RET
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;@@@@@@@@@@@@@@@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@@@@@@@@@@@@@@@@@@@@@@
DLAYms:
MOV R6,#150
MOV B,#00
MS1: DJNZ B,$ ;((2*255)+(2*255)*150
DJNZ B,$ ;=153 MILLI SECONDS
DJNZ R6,MS1
RET
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
L_DELAY:
MOV R7,#0AH ;153 MILLISECONDS * 10
LLL: LCALL DLAYms ;1.53 SECONDS
DJNZ R7,LLL
RET
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
END
|
|
|
Read-Only
Author emmad hassan
Posted 24-Sep-2003 05:30 GMT
Toolset C51
|
 RE: 24c04 Read & Write
emmad hassan
hi. actually i am using c51 language for this job of interfacing 24C04 with 89c52 microcontroller can u give me a code in c51 language for that.i will be thankful to u.thanks.
|
|
|
Read-Only
Author Stefan Duncanson
Posted 24-Sep-2003 09:15 GMT
Toolset C51
|
 RE: 24c04 Read & Write
Stefan Duncanson
"i will be thankful to u"
That's not good enough, I want MONEY.
Stefan
|
|
|
Read-Only
Author Peter Williams
Posted 10-Apr-2004 05:19 GMT
Toolset C51
|
 RE: 24c04 Read & Write
Peter Williams
does anyone have any debug/signal functions for this kind of bit-level I2C code?
Keil have an app note for I2C signal functions that respond to byte-registered I2C hardware blocks, but not I2C devices which the C51 controls directly, by programming the 2 pins, bit at a time, clock at a time.
|
|
|
Read-Only
Author Michael Baldischweiler
Posted 11-Apr-2004 13:08 GMT
Toolset C51
|
 RE: 24c04 Read & Write
Michael Baldischweiler
Hi,
look on my homepage (http://www.c51.de). I have written a complete I²C-Bus DLL with some simulations (RAM, EEPROM, RTC, I/O-Expander, ..)
Mike
|
|
|
Read-Only
Author Peter Williams
Posted 12-Apr-2004 04:14 GMT
Toolset C51
|
 RE: 24c04 Read & Write
Peter Williams
Michael
Your I2C add-on for simulating serial eeproms worked very nicely. It clearly showed the 2-wire physical layer signalling, and nicely simulated responses to the application layer commands.
It was much more than I was expecting!
Thanks,
Peter.
|
|