View previous topic :: View next topic |
Author |
Message |
dneale
Joined: 25 Nov 2009 Posts: 9 Location: Albuquerque NM
|
Real Time Clock Runs at Double Speed |
Posted: Wed Nov 24, 2010 12:30 pm |
|
|
I'm setting up the real time clock in a 24HJ64GP202 using compiler 4.114 with the built in setup, read and write functions. All this works fine, I can set and read the clock. However the clock output, i.e., seconds, is running at two Hertz!
I've checked the oscillator and it measures 32,766 Hz so that is within tolerance. The oscillator pin signal is about 1.9 volts and I don't know what that voltage is supposed to be. On the scope the clock looks more like a rounded triangle wave than a sine wave but again I don't know what it is supposed to look like.
I looked in the Microchip 24F/H reference manual but didn't see anything there that helps.
Anyone with ideas? _________________ Dave N |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Nov 24, 2010 2:05 pm |
|
|
What if the RTC only runs at the correct speed with a scope probe
attached to the crystal ? Did you test the RTC speed in that situation ? |
|
|
dneale
Joined: 25 Nov 2009 Posts: 9 Location: Albuquerque NM
|
Real Time Clock Runs at Double Speed |
Posted: Fri Nov 26, 2010 4:47 pm |
|
|
The clock output, as read by the software function, always runs at double speed regardless if the oscilloscope is connected to the XTAL output or not.
Dave _________________ Dave N |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Nov 26, 2010 5:28 pm |
|
|
I don't have the PCD compiler, so I can't do my usual method of looking at
a test program. I'm not sure if I can help much more. |
|
|
gpsmikey
Joined: 16 Nov 2010 Posts: 588 Location: Kirkland, WA
|
|
Posted: Fri Nov 26, 2010 5:31 pm |
|
|
Only thing that comes to mind here is the possibility that the setup routine in the compiler is wrong - what if you were do do the setup yourself - do you still get the same results ?
mikey _________________ mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3 |
|
|
dneale
Joined: 25 Nov 2009 Posts: 9 Location: Albuquerque NM
|
|
Posted: Sun Nov 28, 2010 10:20 pm |
|
|
Good suggestion. I'll give that a try.
Thanks _________________ Dave N |
|
|
dneale
Joined: 25 Nov 2009 Posts: 9 Location: Albuquerque NM
|
Real Time Clock Runs at Double Speed: MOSTLY SOLVED |
Posted: Wed Dec 15, 2010 8:04 am |
|
|
I took a longer measurement of the timing and discovered that the error was not exactly double. That led me to believe the problem was not in the software. The clock output scope photos from Microchip document TB097 and my clock output were somewhat different.
I adjusted (upward) the series capacitors and got a clock response close to the proper timing but the capacitor values were almost double what the Microchip, and PIC List equations predict is required. (For a 12.5 pF load the series cap should be about 22pF versus the 36 pF needed in my circuit.)
Using these low frequency crystals is not as simple as the higher frequency ones seem to be.
Does anyone have a favorite 32 kHz crystal type/manufacturer they have had success with?
Thanks _________________ Dave N |
|
|
|