Continue to Site

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 the RTC HT1380 with µ Controller 89C51

Status
Not open for further replies.

mak_goel

Junior Member level 3
Joined
Nov 30, 2006
Messages
31
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,541
ht1380 example

Dear All,
Help rquired to interface the RTC HT1380 with Micro 89C51 in assembly coding only as i dont know C.

Kindly help.

Regards
Mak

Added after 4 hours 57 minutes:

Any body help!!!!!!!

Added after 39 seconds:

Any body help!!!!!!!

Added after 1 minutes:

Any body help!!!!!!!
 

interfacing rtc with controllers

You can find C code HT1380 drive here:
http://www.daxia.com/list_1243.shtml
**broken link removed**

I translate that code to 8051 assembly format here :
Code:
SCLK     EQU    P1.0
IO       EQU    P1.1
REST     EQU    P1.2

ht1380_out:
         MOV    R7,#8
ShiftOut:       
         RRC    A
         MOV    IO,C
         SETB   SCLK
         CLR    SCLK
         DJNZ   R7,ShiftOut
         RET

ht1380_in:
         SETB   IO
         MOV    R7,#8
ShiftIn:           
         MOV    C,IO
         RRC    A
         SETB   SCLK
         CLR    SCLK
         DJNZ   R7,ShiftIn
         RET

read_ht1380:
         CLR    SCLK
         CLR    REST
         SETB   REST
         ACALL  ht1380_out
         ACALL  ht1380_in
         CLR    REST
         SETB   SCLK
         RET

write_ht1380:
         CLR    SCLK
         CLR    REST
         SETB   REST
         ACALL  ht1380_out
         MOV    A,B
         ACALL  ht1380_out
         CLR    REST
         SETB   SCLK
         RET
         
; ***********************************
;             Sample code
; ***********************************

; ***** unprotect
         MOV      A,#$8E
         MOV      B,#0
         ACALL    write_ht1380
         
; ***** start         
         MOV      A,#$80
         MOV      B,#0
         ACALL    write_ht1380
         
; ***** Protect         
         MOV      A,#$8E
         MOV      B,#$80
         ACALL    write_ht1380
         
         ...
         ...
         ...

Good luck
 

real-time clock rtc ht1380

Thanks every body to help me and specially thanks to Mr. Budhy to give me the code in assembly language. I move further as per your guidence.

Thanks
Mak
 

real time clock ht1380

The datasheet you want
 

rtc ht1380

Thanks Mr. Buddhy,
My problem to read the RTC HT1380 solved by using your assembly codes.

Really heartly thanks to you.

Regards
Mak
 

how to interface 89c2051

Code:
Thanks Mr. Buddhy, 
My problem to read the RTC HT1380 solved by using your assembly codes. 
Really heartly thanks to you. .

I ALSO THANKS Mr BUDDHY.
NOW I GOT SOME IDEA AND CODE FOR ME WHICH IS FORCE ME DO SOMETHINK
BASED ON HT1380 WHICH IS AVAILABE WITH FROM A 2 YEARS.
THANKS FOR DATASHEET ALSO
I ALSO THANK TO mak_goel WHO RECHARG ME ABOUT HT1380.
 

rtc ht 1380

hi all,

but wat is RTC?!
 

ht1380 c code

real time clock
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top