Page 1 of 1
CMOS
Posted: Thu Dec 09, 2010 10:26 am
by melgmry0101b
Hi everyone,
I want to read the time and date from the CMOS.
I am using visual c++ 2005
i read the wiki document but it doesn't run
---------------
Thank you in advance
Re: CMOS
Posted: Thu Dec 09, 2010 10:35 am
by thepowersgang
I point you to the forum rules and the "How to asks questions the smart way" link
Just saying "it doesn't" work is useless. It's just about as useful as ringing up a doctor and telling him "I feel sick" and expecting him to tell you exactly what is wrong over the phone.
"It doesn't run" - How doesn't it run? Does it not compile, does the code never execute, does it crash? And if so, how does it crash? Are you using Bochs, Qemu, VirtualPC, VirtualBox or Real Hardware.
Learn to ask questions correctly, and you will get kind and useful help. Ignore this advice, and expect to be ignored to the rest of your days.
Re: CMOS
Posted: Thu Dec 09, 2010 10:46 am
by melgmry0101b
it returns wrong values on boches , virtual pc and real hardware
Re: CMOS
Posted: Thu Dec 09, 2010 11:06 am
by neon
Hello,
Always make sure to provide non-working code, what you expect for it to perform, and what it is doing. Also, you should never copy and paste code.
Re: CMOS
Posted: Thu Dec 09, 2010 4:09 pm
by Karlosoft
Some values in the CMOS could be stored in BCD format (there are hex values to be used them like decimal). Are you sure your code make this conversion?
Re: CMOS
Posted: Fri Dec 10, 2010 1:08 am
by f2
You can also tell the RTC to store the date/time in binary mode by setting the bit 2 of the status register B. Binary mode is exactly what you would expect the value to be.
Re: CMOS
Posted: Fri Dec 10, 2010 1:13 am
by davidv1992
Not all cmos implementations actually support that, so it is best to just read that register and write code for all possible situations, and not try to edit it.