• AVR Freaks

Hot!MCP39F511 detect if external oscillator is actually used

Author
Lucian Todor
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2020/11/17 05:03:22
  • Location: 0
  • Status: offline
2020/11/19 11:59:49 (permalink)
4 (1)

MCP39F511 detect if external oscillator is actually used

The datasheet of the MCP39F511 says that if an external clock source is not detected, the internal 4MHz oscillator will be used. I wonder, what if the external crystal is not working? I understand that we run on the internal clock source, but this might be problematic.
 
Is there any possibility to check if we run the MCP with the internal or the external clock source? Is there any flag in a register?
 
Thank you in advance,
Lucian

Attached Image(s)

#1

14 Replies Related Threads

    steve1428
    Starting Member
    • Total Posts : 39
    • Reward points : 0
    • Joined: 2020/11/14 01:57:39
    • Location: 0
    • Status: offline
    Re: MCP39F511 detect if external oscillator is actually used 2020/11/29 10:17:22 (permalink)
    0
    Can't you just turn the oscillator off in the configuration setup in MPLAB X ?  or make changes in the config and see how that affects things.  I think there must be a setting in configuration regarding what oscillator to use also.
    #2
    Lucian Todor
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2020/11/17 05:03:22
    • Location: 0
    • Status: offline
    Re: MCP39F511 detect if external oscillator is actually used 2020/11/30 02:21:27 (permalink)
    4 (1)
    The MCP39F511 is a metrology chip and we don't program it nor configuring it via the MPLAB X, so we get this IC as is and we exchange information with it via the USART.
     
    What we've tested is to remove the crystal from the PCB where we can observe that the read values are not as accurate as in the first place (we use a dedicated calibrator as a reference point). So, for us, it is important to know the actual clock source and we're looking to a solution for this.
    #3
    steve1428
    Starting Member
    • Total Posts : 39
    • Reward points : 0
    • Joined: 2020/11/14 01:57:39
    • Location: 0
    • Status: offline
    Re: MCP39F511 detect if external oscillator is actually used 2020/11/30 02:35:46 (permalink)
    2 (1)
    Try using vastly different value oscillators instead of just removing to see what the difference is.  I don't know how close your external oscillator value is in relation to the one on the chip internally.
    Oscillators are cheap and you could temp solder in a header pin to try different ones maybe.
     
    Maybe you can run a simulation in MPLABX with the MCP39F511 and see how it behaves as well.
     
    you could also make an external circuit with a display that actually tells you what the clock is running at if it's that crucial.
     
    Sorry if my obvious responses are annoying, it's fun to think about other problems.
     
     
    #4
    ric
    Super Member
    • Total Posts : 29435
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: MCP39F511 detect if external oscillator is actually used 2020/11/30 02:40:29 (permalink)
    4 (1)
    I think you're missing the point that the OP is trying to find some way to automatically detect which oscillator the chip is using, in case the external one has failed.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #5
    steve1428
    Starting Member
    • Total Posts : 39
    • Reward points : 0
    • Joined: 2020/11/14 01:57:39
    • Location: 0
    • Status: offline
    Re: MCP39F511 detect if external oscillator is actually used 2020/11/30 02:45:46 (permalink)
    0
    That would be the clock speed display then wouldn't it, could even just make an LED light up if the clock speed changes?
    #6
    steve1428
    Starting Member
    • Total Posts : 39
    • Reward points : 0
    • Joined: 2020/11/14 01:57:39
    • Location: 0
    • Status: offline
    Re: MCP39F511 detect if external oscillator is actually used 2020/11/30 03:06:15 (permalink)
    #7
    ric
    Super Member
    • Total Posts : 29435
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: MCP39F511 detect if external oscillator is actually used 2020/11/30 03:32:25 (permalink)
    0
    I think that's going to push up the cost of his product to add one to each.

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #8
    steve1428
    Starting Member
    • Total Posts : 39
    • Reward points : 0
    • Joined: 2020/11/14 01:57:39
    • Location: 0
    • Status: offline
    Re: MCP39F511 detect if external oscillator is actually used 2020/11/30 03:39:25 (permalink)
    0
    He could just buy the best oscillators and do a failure study with the counter on one unit at the shop, then they could come up with an analysis regarding what their failure rate should be.
    The world is filled with devices dependent on their oscillators, how does everyone else handle it? my guess is they just use high quality components and come up with standards to test for periodic verification.
    #9
    ric
    Super Member
    • Total Posts : 29435
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: MCP39F511 detect if external oscillator is actually used 2020/11/30 03:41:06 (permalink)
    3.33 (3)
    The problem is that the device doesn't stop if the oscillator fails, it just becomes less accurate.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #10
    Lucian Todor
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2020/11/17 05:03:22
    • Location: 0
    • Status: offline
    Re: MCP39F511 detect if external oscillator is actually used 2020/12/01 04:09:34 (permalink)
    0
    Yes, ric, you are right and this is what we're trying to know better: "the problem is that the device doesn't stop if the oscillator fails, it just becames less accurate". We're trying to see if there is any possibility to know what is the clock source of the chip.
     
     
    #11
    atferrari
    Super Member
    • Total Posts : 1461
    • Reward points : 0
    • Joined: 2004/07/08 13:09:24
    • Location: Buenos Aires - Argentina
    • Status: offline
    Re: MCP39F511 detect if external oscillator is actually used 2020/12/02 06:47:55 (permalink)
    0
    Hi Lucian,
    Not too clear for me; are you looking for a way to check that from outside the device or you could have a warning signal  via one of the EVENT pins? (That would imply programming it somehow, I know).
    All I know about this IC is by reading the datasheet some time ago.

    Agustín Tomás

    In theory, there is no difference between theory and practice. In practice, however, there is.

    http://cablemodem.fibertel.com.ar/atferrari/
    #12
    Mysil
    Super Member
    • Total Posts : 4062
    • Reward points : 0
    • Joined: 2012/07/01 04:19:50
    • Location: Norway
    • Status: offline
    Re: MCP39F511 detect if external oscillator is actually used 2020/12/02 08:01:12 (permalink)
    5 (2)
    Hi,
    As the MCP39F511  is a preprogrammed, OTP or mask programmed device,
    the OP is restricted to the command set that is available by the serial control interface thru UART communication.
     
    Even if there is a good thing that the device provide a fail-safe clock monitor,
    with switch over to internal FRC oscillator in case of crystal oscillator failure,
    I understand the desire to know if a crystal oscillator failure have occurred,
    and the metering device eventually should be replaced or repaired.
     
    I cannot find any mention of such a facility in the datasheet DS20005393B
    neither as a status bit, nor as a possible Event pin signal.
     
    I think this is a question that should be forwarded to Microchip support, 
    www.microchip.com/support
    or to their sales staff.
     
        Mysil
     
    #13
    Lucian Todor
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2020/11/17 05:03:22
    • Location: 0
    • Status: offline
    Re: MCP39F511 detect if external oscillator is actually used 2020/12/02 08:06:47 (permalink)
    0
    Hi Augustin, it would be great to have inside the MCP39F511 a flag in a register that can be read via USART that tell us what clock source is in use by the MCP39F511.
    #14
    Lucian Todor
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2020/11/17 05:03:22
    • Location: 0
    • Status: offline
    Re: MCP39F511 detect if external oscillator is actually used 2020/12/02 08:12:48 (permalink)
    4 (1)
    Hi Mysil, thank you very much for your guidance and support. We were not able as well to find anything related to this issue and that's why I've asked. We will look further to the Microchip Technical Support.
     
    #15
    Jump to:
    © 2021 APG vNext Commercial Version 4.5