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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/27/05 06:21
Modified:
  10/27/05 06:23

Read: times


 
#103008 - A part of my code!
Responding to: ???'s previous message
Hi
Here is a part of my code that works fine
You can send a data to any of 114 nvram location of this chip
for example for writing a data to ram location:

mov dyta,#25h
mov adres,#50
call rtc_write ;this code sends 25h on 50'th location of memory

and for reading a data from a ram location:

mov adres,#65
call rtc_read
mov a,dyta ;this code read data from location 65, and save it to acc

Read this code and compare it with datasheet timing
for changing time and date you need read datasheet exactly
it says all about this chip

RW,DS,AS,EN ARE PINS EQUIVALENT OF MCU
DATA AND ADRES ARE RAM LOCATIONS OF MCU

RTC_READ:
CLR RTC_RW
CLR RTC_DS
CLR RTC_AS
SETB RTC_DS
SETB RTC_RW
SETB RTC_AS
CLR RTC_EN
MOV P1,ADRES
CLR RTC_AS
CLR RTC_DS
MOV P1,#0FFH
MOV DYTA,P1
SETB RTC_DS
SETB RTC_EN
SETB RTC_AS
RET


RTC_WRITE:
CLR RTC_RW
CLR RTC_DS
CLR RTC_AS
SETB RTC_DS
SETB RTC_RW
SETB RTC_AS
CLR RTC_EN
MOV P1,ADRES
CLR RTC_AS
CLR RTC_RW
MOV P1,DYTA
SETB RTC_RW
SETB RTC_EN
SETB RTC_AS
RET

Good Luck
Mehdi N.Rahni

List of 9 messages in thread
TopicAuthorDate
M48T86            01/01/70 00:00      
   Yes, I've used them before...            01/01/70 00:00      
      CAPHAT            01/01/70 00:00      
         Assembler and 'C'            01/01/70 00:00      
            make it easy on yourself            01/01/70 00:00      
   try these links            01/01/70 00:00      
   A part of my code!            01/01/70 00:00      
   My problrm still remains            01/01/70 00:00      
   8051 and RTC            01/01/70 00:00      

Back to Subject List