Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

while interfacing rtc with 8051 getting logic contentions in proteus

Status
Not open for further replies.

deexith hasan

New Member
i am getting an error logic contentions while stimulating 8051 with ds12887 rtc........how to solve this


here is the code
ORG 0H
ACALL LCDINT

MOV R0,#10
MOV A,#20H
MOVX @R0,A
MOV R0,#11
MOV A,#83H
MOVX @R0,A
MOV R0,#11
MOV A,#03H
MOVX @R0,A
RPT:
MOV R0,#0
MOV R0,#07H
MOV A,#0
NOP
MOVX A,@R0
ACALL DISPLAY
MOV R0,#0
MOV R0,#08H
MOV A,#0
NOP
MOVX A,@R0
ACALL DISPLAY
MOV R0,#0
MOV R0,#09H
MOV A,#0
NOP
MOVX A,@R0
ACALL DISPLAY
ACALL CLEAR
SJMP RPT

LCDINT:MOV P1,#38H
ACALL CMDWR
MOV P1,#0EH
ACALL CMDWR
CLEAR: MOV P1,#01
ACALL CMDWR
RET

CMDWR:
CLR P3.0
CLR P3.1
SETB P3.2
ACALL DELAY
CLR P3.2
RET

DISPLAY:MOV B,A
SWAP A
ANL A,#0FH
ORL A,#30H
ACALL DTWR
MOV A,B
ANL A,#0FH
ORL A,#30H
ACALL DTWR
RET

DTWR:
MOV P1,A
SETB P3.0
CLR P3.1
SETB P3.2
ACALL DELAY
CLR P3.2
RET

DELAY:MOV TMOD,#00000001B
MOV TH0,#00H
MOV TL0,#00H
SETB TR0
AGN: JNB TF0,AGN
CLR TR0
CLR TF0
RET

READY:SETB P1.7
CLR P3.0
SETB P3.1
BACK: CLR P3.2
ACALL DELAY
SETB P3.2
JB P1.7,BACK
RET
END
 

Attachments

  • rtc.JPG
    rtc.JPG
    136.1 KB · Views: 1,329
i programmed 8051 to display hours ,min,sec but i am getting seconds alone displayed on lcd with an error logic contentions
 

Attachments

  • rtc.JPG
    rtc.JPG
    170.7 KB · Views: 1,175
DO NOT DOUBLE POST!!

I had seen your query and was responding as I'm sure several other members were... Having several identical posts is very confusing.....

I have simulated this on ISIS and it seems like an internal read error... Writing to the RTC chip is fine.. Reading the first byte is fine.... The problem is reading the second, third etc... I have tried to instigate a delay between reads but the 8051 doesn't have the correct timing on the RD pin... I know this is the issue because bumping it into Motorola mode there are less errors. I suspect either ISIS has an issue with the simulator or the chip isn't compatible with the micro controller... I will try again tonight and see if I can get an answer..
 
sorry for double posting...thanq u for u r response.......i want to do a digital clock using 8051 and 7 seg display........i simulated in proteus on lcd getting the same error
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top