Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

HOw to interface RTC DS12887 to AT89S51..??

Status
Not open for further replies.

Elits

Member level 4
Joined
Jul 27, 2005
Messages
79
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Indonesia
Activity points
1,982
ds12887 rtc

I want to make simple Digital Clock using RTC and uC, but i don't know how to start?If there anyone know How to interface AT89S51 with RTC DS12887 please help me? If there a schematic and *.asm its better for me, because i'm newbie in uC....
Thanks

Elits
 

IanP

Advanced Member level 5
Joined
Oct 5, 2004
Messages
7,942
Helped
2,309
Reputation
4,620
Reaction score
531
Trophy points
1,393
Location
West Coast
Activity points
66,435
ds12887 example code

Connection between this microcontroller and DS12887 is pretty straightforward:
AD0-AD7 --> P0.0-P0.7
R/W --> WR
DS --> RD
AS --> ALE
IRQ --> if required, to External Interrupt 0 or 1

CS --> 0V
MOT --> 0V
Reset --> 10kΩ (to +5V), 100nF (to 0V)

As far as code is concerned, try this link:

and download --> t.zip <--
In it you will find an example code on Time and Date generator based on 6818 (older version of DS12887) ..
This code doesn't use interrupts so leave IRQ pin not connected ..
If go through this code you will find a lot of MOVX instructions ..
It is how one reads or writes data from/to this RTC and its internal RAM ..

Regards,
IanP
 

sharang

Junior Member level 1
Joined
Jun 2, 2009
Messages
18
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,405
code ds12887

Dear sir,
Need a code in c for interfacing 1288 with 8051.Looking for a simple code,easy to understand.Any changes inn the code given in mazdi book.Please help if possible.Thankyou
 

ctownsend

Advanced Member level 2
Joined
Nov 27, 2004
Messages
575
Helped
93
Reputation
188
Reaction score
63
Trophy points
1,308
Location
Canada
Activity points
3,665
ds12887.zip

I did this a while back for an 89C2051. It will work for any 8051. Using a RS232 interface to test the DS12887, set time, display time, etc. No C code, only asm.

Good Luck

PS Remember "helped me" button!
 

sharang

Junior Member level 1
Joined
Jun 2, 2009
Messages
18
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,405
ds12887 connections with 8051

hey i ussed ur code all i get on the screen of hyperterminal is the menu but not able to input my choice.What can be done?
 

ctownsend

Advanced Member level 2
Joined
Nov 27, 2004
Messages
575
Helped
93
Reputation
188
Reaction score
63
Trophy points
1,308
Location
Canada
Activity points
3,665
how to interface rtc

did you verify that your max232 connections are correct?
What about the terminal settings in hypertermnal?
 

sharang

Junior Member level 1
Joined
Jun 2, 2009
Messages
18
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,405
interfaz para rtc ds12887

both are perfect.....even tried to change the rtc but same thing comes..
 

ctownsend

Advanced Member level 2
Joined
Nov 27, 2004
Messages
575
Helped
93
Reputation
188
Reaction score
63
Trophy points
1,308
Location
Canada
Activity points
3,665
code c for ds12887

troubleshoot your rs232 circuit.

1. disconnect the rs232 circuit from the micro controller.
2. connect the OUT to the IN on the max232
3. in your terminal program type some text, it should be echoed back to the screen.

If this is ok, perhaps the connection from the max232 to the microcontroller is broken.

You can also try bypassing the max232 and just connect TX and RX on your serial port. Then try the terminal program again, You should see the text you are typing.

Good Luck
 

the_kid25

Member level 3
Joined
Jul 30, 2009
Messages
56
Helped
7
Reputation
14
Reaction score
7
Trophy points
1,288
Location
thailand
Activity points
1,612
Re: ds12887.zip

ctownsend said:
I did this a while back for an 89C2051. It will work for any 8051. Using a RS232 interface to test the DS12887, set time, display time, etc. No C code, only asm.

Good Luck

PS Remember "helped me" button!
i need circuit schematic for that code please share and help me
 

ctownsend

Advanced Member level 2
Joined
Nov 27, 2004
Messages
575
Helped
93
Reputation
188
Reaction score
63
Trophy points
1,308
Location
Canada
Activity points
3,665
Re: ds12887.zip

the_kid25 said:
i need circuit schematic for that code please share and help me
look in the zip file, a diagram was included. Not exactly a schematic, but if you read the source code and look at the diagram you will figure it out.
 

sandhyadevit

Newbie level 1
Joined
Nov 10, 2012
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,284
Re: ds12887.zip

hi

the given code didnt help me. rtc does not giving any data..

sandhya
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top