I try to set the CMOS clock programmatically.
I’m working on PC compliant hardware, so I’m using ioport 0x70 and 0x71,
disabling clock updates while setting the new time and day.
But, sometimes I have a completely erratic result, and more often,
everything is back in 1970 (something like 0, for time_t!)
I have brand new batteries for the CMOS!
Do you have any hint ?
Do you have any piece of code that shows how to set the CMOS clock (I might
have done something silly!)
Hi Didier,
Could you give some piece of your code, what exactly you’re doing? Did you use RTC update-ended
interrupt, just poll the bit in status register or exactly set bit in control register to disable
clock updates? What is your hardware? Does you chip allow to disable updates?
You could look at article about RTC clock (it’s in russian ) http://qnx.org.ru/docs-devel/text_rtc.html
Or just grab the example tarball ftp://ftp.qnx.org.ru/pub/projects/ed1k/clock.tgz
Look at SetRTCAlarmTime() (rtc.c/rtc.h) and modify it for SetRTCCurTime() by using regs 0,2,4.
Cheers.
I try to set the CMOS clock programmatically.
I’m working on PC compliant hardware, so I’m using ioport 0x70 and 0x71,
disabling clock updates while setting the new time and day.
But, sometimes I have a completely erratic result, and more often,
everything is back in 1970 (something like 0, for time_t!)
I have brand new batteries for the CMOS!
Do you have any hint ?
Do you have any piece of code that shows how to set the CMOS clock (I might
have done something silly!)
–
+===============================+
Brian K. Hlady
Technical Account Manager
QNX Software Systems, Ltd. bhlady@qnx.com
+===============================+
“Didier Harrang” <didier.harrang@bcisa.com> wrote in message
news:ae7bqu$bj$1@inn.qnx.com…
I try to set the CMOS clock programmatically.
I’m working on PC compliant hardware, so I’m using ioport 0x70 and 0x71,
disabling clock updates while setting the new time and day.
But, sometimes I have a completely erratic result, and more often,
everything is back in 1970 (something like 0, for time_t!)
I have brand new batteries for the CMOS!
Do you have any hint ?
Do you have any piece of code that shows how to set the CMOS clock (I
might
have done something silly!)