Author Topic: Mysterious "Ghost" Internal Oscillator in RTCC  (Read 925 times)

0 Members and 1 Guest are viewing this topic.

Offline tarun172Topic starter

  • Regular Contributor
  • *
  • Posts: 69
  • Country: us
Mysterious "Ghost" Internal Oscillator in RTCC
« on: February 17, 2020, 03:30:30 pm »
Hi,
    I am working on a new design that involves a MCP79XXX series serial RTCC chip from Microchip. While writing interface to this RTCC chip, I ran into issue where RTCC would not count.  As I start to dig in a little bit more, there were two problems:
1. I need to turn ON start start oscillator bit in seconds register in addition to setting external oscillator in control register.
2. I found that values of load capacitors connected to crystal oscillator were not of correct value. This, I found out much much later.

After spending some time to solve this issue; I turned off external oscillator in control register and turned ON start oscillator bit. To my surprise RTCC started "counting"; meaning seconds counter was incrementing. I tested on two boards to verify that RTCC was indeed counting.

Thing that got my head scratching is my opinion RTCC should not count because  (1) Load capacitance value is wrong far below recommended limit. Therefore, crystal oscillator should not oscillate. I verified this using Oscope on two boards that I tested, (2) External Oscillator is turned off.

As anybody seen this before? Microchip confirms that there is not internal oscillator. So how would RTCC just magically start to count? Am I missing something here? |O |O

tarun172

« Last Edit: February 17, 2020, 03:42:11 pm by tarun172 »
Thanks & Regards,
Tarun S
 

Offline hexreader

  • Frequent Contributor
  • **
  • Posts: 269
  • Country: england
Re: Mysterious "Ghost" Internal Oscillator in RTCC
« Reply #1 on: February 17, 2020, 03:39:26 pm »
Exactly which RTCC chip?

Please post full, accurate schematic.
 

Offline DrG

  • Super Contributor
  • ***
  • !
  • Posts: 1199
  • Country: us
Re: Mysterious "Ghost" Internal Oscillator in RTCC
« Reply #2 on: February 17, 2020, 04:17:03 pm »
Hi,
    I am working on a new design that involves a MCP79XXX series serial RTCC chip from Microchip. While writing interface to this RTCC chip, I ran into issue where RTCC would not count.  As I start to dig in a little bit more, there were two problems:
1. I need to turn ON start start oscillator bit in seconds register in addition to setting external oscillator in control register.
2. I found that values of load capacitors connected to crystal oscillator were not of correct value. This, I found out much much later.

After spending some time to solve this issue; I turned off external oscillator in control register and turned ON start oscillator bit. To my surprise RTCC started "counting"; meaning seconds counter was incrementing. I tested on two boards to verify that RTCC was indeed counting.

Thing that got my head scratching is my opinion RTCC should not count because  (1) Load capacitance value is wrong far below recommended limit. Therefore, crystal oscillator should not oscillate. I verified this using Oscope on two boards that I tested, (2) External Oscillator is turned off.

As anybody seen this before? Microchip confirms that there is not internal oscillator. So how would RTCC just magically start to count? Am I missing something here? |O |O

tarun172



In addition to what the previous poster requested...I'm not certain exactly what you are asking? RTCC does not magically start, it needs either an external crystal or an external clock source. Failing one of those, it is not going to count.

Have you looked through the "Common Issues" AN1496 http://ww1.microchip.com/downloads/en/Appnotes/00001496B.pdf ?
and also "Question and Answers" TB316 http://ww1.microchip.com/downloads/en/Appnotes/90003116A.pdf .

"1. I need to turn ON start start oscillator bit in seconds register in addition to setting external oscillator in control register. "

That sounds like one problem that you had.

"The oscillator must be started by setting the STbit in the  RTCSEC  register if a crystal is being used,  or by setting the EXTOSC bit in the Control register, if  an  external clock source is used.  Also, refer to the following documents:AN1365  –  “Recommended  usage  of  MicrochipSerial   RTCC   Devices”   (DS00001365)   and AN1519 –  “Recommended  crystals  for  Stand-Alone RTCCs” (DS00001519)."

So, it is one OR the other, depending upon whether you are using a crystal or an external clock source, but not both.

It sounds like you figured that out....

After spending some time to solve this issue; I turned off external oscillator in control register and turned ON start oscillator bit. To my surprise RTCC started "counting"; meaning seconds counter was incrementing. I tested on two boards to verify that RTCC was indeed counting.

But, it is not surprising and they even say...

"Make sure the Start bit (ST) in register 00h is set; set ST = 1 to enable the oscillator.•  Check if the EXTOSC bit in the Control register (07h) is clear; EXTOSC =0. This should be cleared when using an external crystal."


Thing that got my head scratching is my opinion RTCC should not count because  (1) Load capacitance value is wrong far below recommended limit. Therefore, crystal oscillator should not oscillate. I verified this using Oscope on two boards that I tested, (2) External Oscillator is turned off.

Not sure how you determined the load capacitance value (1) but for (2), as stated, EXTOSC must be cleared if using a crystal.

Assuming that I have not completely misunderstood you, hope this helps.


Edit: Re-reading your post, it is possible that what you are "missing" is simply their distinction between a crystal source and an external oscillator source. Yeah, since they do not have an internal oscillator, both could be considered "external", but clearly they are looking at the distinct cases of using a crystal and pins X1 and X2 versus "X1 also serves as the external clock input when the MCP7940X is configured to use an external oscillator[/i]"
« Last Edit: February 17, 2020, 04:34:29 pm by DrG »
- Invest in science - it pays big dividends. -
 

Offline tarun172Topic starter

  • Regular Contributor
  • *
  • Posts: 69
  • Country: us
Re: Mysterious "Ghost" Internal Oscillator in RTCC
« Reply #3 on: February 17, 2020, 05:03:46 pm »
Hi Dr. G,
            Thanks for bringing this to my attention. I went completely off datasheet of MCP79XX Series and chip errata. It says "Note: The EXTOSC bit must be set to enable an external clock source". So the info, "Make sure the Start bit (ST) in register 00h is set; set ST = 1 to enable the oscillator.•  Check if the EXTOSC bit in the Control register (07h) is clear; EXTOSC =0. This should be cleared when using an external crystal." should be in errata. Very strange.

I determined load capacitance per section 5.2 equation,

CL = CX1 X CX2
       -------------  × C STRAY

        CX1 + CX2                   
Where:
CL = Effective load capacitance
CX1 = Capacitor value on X1 + COSC
CX2 = Capacitor value on X2 + COSC
CSTRAY = PCB stray capacitance

They also say suitable crystals have a load capacitance (CL) of 6-9 pF. Inadvertently, I selected 2 pF load crystal instead of 6-9 pF.

tarun172

 

« Last Edit: February 17, 2020, 06:26:35 pm by tarun172 »
Thanks & Regards,
Tarun S
 

Offline DrG

  • Super Contributor
  • ***
  • !
  • Posts: 1199
  • Country: us
Re: Mysterious "Ghost" Internal Oscillator in RTCC
« Reply #4 on: February 17, 2020, 07:53:28 pm »
I think that you have it figured out.

Just an interesting aside. I see the 5.2 equation. Take a look at http://ww1.microchip.com/downloads/en/Appnotes/00001519B.pdf and Equation 1. Notice that they had added the pin capacitance to the formula (citing it as 3 pF typical).

Actually, in my view, Microchip is pretty good with their data sheets (*ducks to avoid thrown objects*) at least compared to some others. Especially so when the product is mature and there are some supplementary notes out there.
- Invest in science - it pays big dividends. -
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 7492
  • Country: ca
Re: Mysterious "Ghost" Internal Oscillator in RTCC
« Reply #5 on: February 17, 2020, 09:52:19 pm »
It's a bit hilarious these Microchip RTC's are super cheap and full of bugs. I've learned the extra debugging time and product failures ain't worth BOM cost savings.
Just how hard is it to make a decent RTC after all the decades they've been around?

erratas have major issues. OP didn't give us the part number he's using.
"...errata described in this document will be addressed in future revisions of the MCP7940N silicon."
Silicon rev. not in the part number or a register, good luck tracking that down.
 

Offline tarun172Topic starter

  • Regular Contributor
  • *
  • Posts: 69
  • Country: us
Re: Mysterious "Ghost" Internal Oscillator in RTCC
« Reply #6 on: February 17, 2020, 10:12:16 pm »
I realize now that document was somewhat confusing. MCP79XX series can be driven by two sources external clock or an oscillator. When they say Disable external 32.768 kHz input what they really mean is disable external clock input and enable external oscillator. MFP Block diagram in datasheet covers this in detail. EXTOSC is logically connected to OR gate input. It is just confusing the way datasheet has been written.

bit 3 EXTOSC: External Oscillator Input bit
1 = Enable X1 pin to be driven by external 32.768 kHz source
0 = Disable external 32.768 kHz input

Thank you all. @hexreader @floobydust @DrG
Thanks & Regards,
Tarun S
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf