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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/12/02 08:52
Read: times


 
#24311 - Reading My Dates ( DS1642 )
The DS1642 is an RTC + NVRAM
The information is in centain memory locations in bcd format:

DS1642

Ok , so i made a simple program to display the
minutes :


#include <reg51.h>

xdata minutes _at_ 0x07FA;    //this is the memory location containing minutes
xdata control _at_ 0x07F8;    //this is the control reg

void main()
{

while(1)
{
    control = 0x40;           //set the read bit
    putchar(13);putchar(10);putchar('m');putchar('=');  //eye candy
    punchar(minutes);
    control = 0x00;           //reset the read bit
    delay(100);
}
}



The minutes counter should advance after every minute , but it doesnt.
Whats wrong with the prog?


List of 10 messages in thread
TopicAuthorDate
Reading My Dates ( DS1642 )            01/01/70 00:00      
RE: Reading My Dates ( DS1642 )            01/01/70 00:00      
RE: Reading My Dates ( DS1642 )            01/01/70 00:00      
RE: Reading My Dates ( DS1642 ) /Jose            01/01/70 00:00      
RE: Reading My Dates ( DS1642 )            01/01/70 00:00      
RE: Reading My Dates ( DS1642 )            01/01/70 00:00      
RE: Reading My Dates ( DS1642 )            01/01/70 00:00      
RE: Reading My Dates ( DS1642 )            01/01/70 00:00      
RE: Reading My Dates ( DS1642 )            01/01/70 00:00      
RE: Reading My Dates ( DS1642 )            01/01/70 00:00      

Back to Subject List