Internal Oscillator and WDT...

Discussion in 'Embedded Systems and Microcontrollers' started by dtvonly, Nov 14, 2014.

  1. dtvonly

    Thread Starter Member

    Dec 14, 2012
    43
    0
    Hi. Consider this scenario: I am running my system at 16MHz. I would like to have WDT running as well to prevent "software running away".

    My question: My system is 16MHz while WDT will automatically invoke low frequency internal oscillator of 31kHz. Which OSC frequency does the system (INTOSC) runs on now, 16MHz or 31kHz?

    This is on a PIC16 MCU. Please see attachment for more information. Thank you.
     
  2. Papabravo

    Expert

    Feb 24, 2006
    10,137
    1,786
    I think it runs on both. There is nothing inherently wrong with having multiple oscillators in a part -- is there?
     
  3. dtvonly

    Thread Starter Member

    Dec 14, 2012
    43
    0
    Hi. Yes and no. Please note that I am using only the internal oscillator block therefore my concern here is that my 16MHz may get switched over to 31.25kHz. Please view the attached full system oscillator block and you will see that if I use an external XTAL/Oscillator circuit then I won't have to worry when the LFINTOCS of 31.25kHz kicks in for the WDT. Please advise on original inquiries. Thank you.
     
  4. JohnInTX

    Moderator

    Jun 26, 2012
    2,341
    1,024
    Which PIC are you using? Even with the multiple internal/external clocks, on every one I've seen the WDT has its own, dedicated RC oscillator independent of all other clocks. Its job is not to clock the PIC but to reset it if not refreshed.

    Are you referring to the secondary 'backup' oscillator?
     
    ErnieM likes this.
  5. dtvonly

    Thread Starter Member

    Dec 14, 2012
    43
    0
    Hi. I found this more complete oscillator block diagram. this makes more sense. From this I can see that the 16MHz will not be affected once the WDT is enabled (to do COP). This makes sense. See attachment.
     
  6. dtvonly

    Thread Starter Member

    Dec 14, 2012
    43
    0
    Hi all. The PIC16LF1708 had a more complete block diagram then did the PIC18F24K22. I think that this is just a microchip documentation issue. It got me confused from what I already knew about WDT. Yes in general WDT has its own dedicated clock and it should not interfere with the system clock. Thread resolve. Thanks all.
     
  7. Art

    Distinguished Member

    Sep 10, 2007
    785
    61
    It's a dirty old clock that does nothing else.
    You could have tested it by quickly flashing an LED in a loop with no WDT reset.
    It takes a couple of seconds.
     
Loading...