Author Topic: PC RTC does not run while PC is turned off - FIXED  (Read 6591 times)

0 Members and 5 Guests are viewing this topic.

Online AndersJTopic starter

  • Frequent Contributor
  • **
  • Posts: 420
  • Country: se
PC RTC does not run while PC is turned off - FIXED
« on: July 04, 2016, 05:04:48 pm »
The RTC seems to not run while the PC is turned off.
As if the oscillator is dead.
After setting the time, all is well while the machine runs.

I don't know if the RTC is used while operating or if time is kept by software.
If so, perhaps the RTC never runs at all.

I have:
- Checked the battery, it is OK.
- Disabled and reenabled the RTC from within the system manager
- Remove the battery a few minutes
- Set the bios to its defaults

The machine is a HP wx4600 workstation, Windows 10.
The issue was identical previously under W7.

Any ideas?



« Last Edit: July 05, 2016, 03:33:27 pm by AndersJ »
"It should work"
R.N.Naidoo
 

Online helius

  • Super Contributor
  • ***
  • Posts: 3777
  • Country: us
Re: PC RTC does not run while PC is turned of
« Reply #1 on: July 04, 2016, 05:09:37 pm »
defective 32 kHz crystal
It is built into larger "Mostek Timekeeper" type devices, but may also be discrete
 

Online AndersJTopic starter

  • Frequent Contributor
  • **
  • Posts: 420
  • Country: se
Re: PC RTC does not run while PC is turned of
« Reply #2 on: July 04, 2016, 05:42:28 pm »
Excellent suggestion, but no, unfortunately.
It oscillates at 0,6 Vpp at 32768 Hz.


"It should work"
R.N.Naidoo
 

Offline kfitch42

  • Frequent Contributor
  • **
  • Posts: 300
  • Country: us
Re: PC RTC does not run while PC is turned of
« Reply #3 on: July 04, 2016, 06:41:05 pm »
Most OSes these days read the RTC on boot, and write to it at shutdown, and don't touch it inbetween.

You have a couple of options if you want to really diagnose this thing:
1) Boot a linux CD/usb image. (e.g. Knoppix)
2) Note the reported time.
3) Wait a bit just to be sure.
4) Pull the plug from the wall (so it can't have a chance to touch the RTC).
5) Boot linux again and note the reported time. If it hasn't changed much from (2) then it seems the RTC is just stuck. If it has updated, then perhaps there is something wrong with the powersupply doing something funny in standby?!?! Then again the backup battery should take care of that, right?!?

Another option would be to directly access the RTC chip. I know how to do this in Linux, not so sure about Windows. Again, something like Knoppix might help here.

Compile/run a quick and dirty program like this (this is just off the top of my head, so it might be a little off):
// begin seconds.c
#include <sys/io.h>
#include <stdio.h>
#include <unistd.h>
int main(void) {
// RTC and CMOS battery backed RAM are on ports 0x70 and 0x71
// for more info see http://bochs.sourceforge.net/techspec/PORTS.LST
ioperm(0x070, 0x2, 1);
// address 0 is the RTC seconds
outb(0x70, 0);
printf("Seconds: %d\n", inb(0x71));
}
// end seconds.c

# #Compile the program
# gcc -o seconds seconds.c
# # Run it as root
# sudo ./seconds
# # wait a bit
# sleep 10
# # run it again
# sudo ./seconds

This should see if the RTC is updating.

 

Offline alsetalokin4017

  • Super Contributor
  • ***
  • Posts: 2055
  • Country: us
Re: PC RTC does not run while PC is turned off
« Reply #4 on: July 04, 2016, 08:34:51 pm »
@kfitch42:

The code compiles without errors, and runs, but produces no output for me, just returns me to the command prompt. What am I doing wrong?  :-\

This prints "test: 23"
Code: [Select]
#include <sys/io.h>
#include <stdio.h>
#include <unistd.h>
int main(void) {
ioperm(0x070, 0x2, 1);
// outb(0x70, 0);
// printf("Seconds: %d\n",inb(0x71));
printf("test: %d\n", 23);
}

But this prints nothing, just returns me to the command prompt:
Code: [Select]
#include <sys/io.h>
#include <stdio.h>
#include <unistd.h>
int main(void) {
ioperm(0x070, 0x2, 1);
outb(0x70, 0);
printf("Seconds: %d\n",inb(0x71));
printf("test: %d\n", 23);
}
« Last Edit: July 04, 2016, 08:47:48 pm by alsetalokin4017 »
The easiest person to fool is yourself. -- Richard Feynman
 

Online NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9785
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: PC RTC does not run while PC is turned off
« Reply #5 on: July 04, 2016, 11:44:20 pm »
There's already a command - hwclock - for interacting with the RTC.
http://linux.die.net/man/8/hwclock
Cryptocurrency has taught me to love math and at the same time be baffled by it.
Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
BTC: 18813fu8LQEdDwH9YLM1ABed3XwCfeSeFi
 

Online AndersJTopic starter

  • Frequent Contributor
  • **
  • Posts: 420
  • Country: se
Re: PC RTC does not run while PC is turned off - FIXED
« Reply #6 on: July 05, 2016, 01:03:34 pm »
I fixed it!

I'm not absolutely sure what fixed this,
but,
it seems the RTC and the cmos ram might NOT be cleared/reset
just by taking out the battery for a few minutes.

When I also pulled the mains cord, and had the battery out,
then there were major Bios complaining about CMOS-setups being corrupt.
With only the battery out I did not get theses error messages.

After resetting bios settings, the RTC ran also while the PC was powered down.

So,
my follow up questions is:
Is it reasonable to believe that on some machines,
the CMOS RAM and RTC will be powered by the incoming mains,
even when the PC is turned off?


I can easily try this,
but after a few hours of head scratching I prefer to not
risk ending up in a similar situation again.

"It should work"
R.N.Naidoo
 

Online Monkeh

  • Super Contributor
  • ***
  • Posts: 8854
  • Country: gb
Re: PC RTC does not run while PC is turned off - FIXED
« Reply #7 on: July 05, 2016, 02:09:50 pm »
So,
my follow up questions is:
Is it reasonable to believe that on some machines,
the CMOS RAM and RTC will be powered by the incoming mains,
even when the PC is turned off?


This is standard practice, yes. Why drain your battery when you have a standby supply? All ATX supplies have a permanent +5V rail.
 
The following users thanked this post: Kilrah

Online AndersJTopic starter

  • Frequent Contributor
  • **
  • Posts: 420
  • Country: se
Re: PC RTC does not run while PC is turned off
« Reply #8 on: July 05, 2016, 02:24:09 pm »
When did this become "standard practice"?
I have never seen this mentioned until today.
All I've seen is "remove the battery and put it back after a few minutes"?
"It should work"
R.N.Naidoo
 

Online Monkeh

  • Super Contributor
  • ***
  • Posts: 8854
  • Country: gb
Re: PC RTC does not run while PC is turned off
« Reply #9 on: July 05, 2016, 02:25:43 pm »
When did this become "standard practice"?
I have never seen this mentioned until today.
All I've seen is "remove the battery and put it back after a few minutes"?

Uh.. since always. That instruction assumes you have already disconnected the power supply. As you always should when working inside equipment unless you know exactly what you're doing (not knowing about +5VSB.. yeah.).
 
The following users thanked this post: Kilrah

Online AndersJTopic starter

  • Frequent Contributor
  • **
  • Posts: 420
  • Country: se
Re: PC RTC does not run while PC is turned off
« Reply #10 on: July 05, 2016, 03:32:48 pm »
I would like to think I know what I am doing after 40+ years in the electronics design business.

Since I do "know", I compromise at times, and occasionally fall into traps like this one.
It never occurred to me that the standby 5V is used for anything else,
but for power on standby circuitry.

Not a day without learning something new.

Does anyone have a motherboard schematic diagram that illustrates how
the 5V standby voltage is gated with the battery to supply the RTC?






"It should work"
R.N.Naidoo
 

Offline edavid

  • Super Contributor
  • ***
  • Posts: 3787
  • Country: us
Re: PC RTC does not run while PC is turned off - FIXED
« Reply #11 on: July 05, 2016, 03:54:54 pm »
Did you happen to notice the "clear CMOS" jumper posts next to the battery holder?
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4589
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: PC RTC does not run while PC is turned off
« Reply #12 on: July 05, 2016, 04:04:08 pm »
.
It never occurred to me that the standby 5V is used for anything else,
but for power on standby circuitry.
The RTC is part of the power-on circuit. It is powered up to perform wake on alarm.
Also powered up:
The nic (wake on lan)
The usb hub (wake on keyboard)
That is condering you're at S5. Windows 8+ tries to not go that low unless you excplitely ask shutdown.
 

Online Monkeh

  • Super Contributor
  • ***
  • Posts: 8854
  • Country: gb
Re: PC RTC does not run while PC is turned off
« Reply #13 on: July 05, 2016, 04:04:45 pm »
I would like to think I know what I am doing after 40+ years in the electronics design business.

Since I do "know", I compromise at times, and occasionally fall into traps like this one.
It never occurred to me that the standby 5V is used for anything else,
but for power on standby circuitry.

Not a day without learning something new.

Does anyone have a motherboard schematic diagram that illustrates how
the 5V standby voltage is gated with the battery to supply the RTC?

Fair enough. The 5V is usually regulated down to 3.3V, and then diode OR'd with the battery. Nothing runs off 5V directly these days!

You'll also find the chipset fed by that 3.3V supply separately, as well as typically several other supplies (an ICH9 requires four different supplies in 'suspend' mode).

Off the top of my head, a little googling will find an Abit IP35 Pro schematic (I happen to have a few of these, so that's one I know is around).
 

Online AndersJTopic starter

  • Frequent Contributor
  • **
  • Posts: 420
  • Country: se
Re: PC RTC does not run while PC is turned off - FIXED
« Reply #14 on: July 05, 2016, 05:50:10 pm »
Did you happen to notice the "clear CMOS" jumper posts next to the battery holder?

Yes, there are undocumented jumpers in the battery area.
I did not however want to short them while power was on.
There is a pushbutton, which did not work, at least not with the battery in place.
I unplugged the power cord, removed the battery, shorted the jumpers, and pressed the button.
Not sure if any of these actions where redundant, but after this, the RTC runs during power down.
"It should work"
R.N.Naidoo
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4589
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: PC RTC does not run while PC is turned off - FIXED
« Reply #15 on: July 05, 2016, 06:19:20 pm »
You can use the jumpers with the battery inserted. Some motherboards have reset buttons, this suggests unplugging the power supply is not required either.
Just don't do it when the system is on or hibernating.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->