• Welcome
  • MCP39F511 detect if external oscillator is actually used
2020/11/19 11:59:49
Lucian Todor
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)

2020/11/29 10:17:22
steve1428
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.
2020/11/30 02:21:27
Lucian Todor
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.
2020/11/30 02:35:46
steve1428
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.
 
 
2020/11/30 02:40:29
ric
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.
 
2020/11/30 02:45:46
steve1428
That would be the clock speed display then wouldn't it, could even just make an LED light up if the clock speed changes?
2020/11/30 03:32:25
ric
I think that's going to push up the cost of his product to add one to each.
2020/11/30 03:39:25
steve1428
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.
2020/11/30 03:41:06
ric
The problem is that the device doesn't stop if the oscillator fails, it just becomes less accurate.
 
12
© 2021 APG vNext Commercial Version 4.5

Use My Existing Forum Account