Dallas RTC Reading Strange Hours

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hi,
    We use the Dallas DS1337 RTC. In general it seems to work OK.
However I'm trying to understand a behaviour in which it's possible to
read an HOURS register reading of 25. The RTC is initialised for 24
hour operation.

    Has anyone come across this behaviour?

TIA,
    Ken

+====================================+
I hate junk email. Please direct any
genuine email to: kenlee at hotpop.com

Re: Dallas RTC Reading Strange Hours
snipped-for-privacy@noname.com (Ken Lee) wrote in message
Quoted text here. Click to load it

25 (decimal) is 0x19, or 7pm in real money,
Sprow.

Re: Dallas RTC Reading Strange Hours

Quoted text here. Click to load it

Sorry, I should have been a bit more precise with my description of
the data for those who are not familiar with this type of device. The
Dallas DS1337 as with other similar RTC's (eg Philips PCF8563, etc)
express the time/date in the registers in BCD form. So I really meant
25 in BCD.

Ken.


+====================================+
I hate junk email. Please direct any
genuine email to: kenlee at hotpop.com

Re: Dallas RTC Reading Strange Hours
Quoted text here. Click to load it
Are you sure that there isn't a binary/BCD bit in the configuration register
as found on the DS12C887?

    Andrew



Re: Dallas RTC Reading Strange Hours

Quoted text here. Click to load it

Hi,
    These particular devices are hardcoded to work only in BCD
(for calendar & time). I'm speculating that there's some (missing)
initialisation condition or illegal value that may cause the device to
operate in such as manner. Apart from that, the equipment with the
DS1337 appears to be operating and displaying the correct date/time
the majority of the time. Basically I'm trying to capture or
understand the error condition that could get the DS1337 into this
error state. Although there's no conclusive evidence, the problem was
first notice after the equipment was tested under brown-out
conditions. I've only looked at the "hours" but these don't seem to
recover back to correct operation.

Ken.

+====================================+
I hate junk email. Please direct any
genuine email to: kenlee at hotpop.com

Re: Dallas RTC Reading Strange Hours
On Mon, 06 Sep 2004 23:00:03 GMT, snipped-for-privacy@noname.com (Ken Lee)

Quoted text here. Click to load it

I once was getting  strange times like 38:17:98, I forgot to convert
the BCD to binary and back! Maybe you overlooked that too?

unsigned char BIN2BCD(unsigned char value)
{
 unsigned char x10 = 0;
 unsigned char x = 0;
 unsigned char aux;

 x10 = (unsigned char) value / 10;
 x10 *= 16;
 x = (unsigned char) value % 10;
 aux = x10 + x;

 return aux;
}

unsigned char BCD2BIN(unsigned char value)
{
 unsigned char d;
 unsigned char a;

 a = value;
 d = value & 0x0F;
 a >>= 4;
 a &= 0x0F;
 a *= 10;
 d += a;

 return d;
}



----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000
Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---

Site Timeline