INT2 anomaly in DT_INTS-18??


Closed Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default Would like to understand this

    Quote Originally Posted by Darrel Taylor View Post
    Without the PAUSE, there's nothing to keep the Watch Dog Timer clear.
    Thanks for the answer, Darrell. However, your answer raises some questions that I would like to understand the "why" of as a PICBASIC programmer so that I am not just blindly implementing code:

    1) How is a PICBASIC programmer supposed to know that the WDT must be kept clear during the Main loop of a program when using the INT2 external intterupt of the DT_INTS-18 include file? I went through the code/comments of DT_INTS-18 and couldn't find anything that advises that.

    2) Must the WDT be kept clear during Main loop when using other interrupts supported by DT_INTS-18 or just for the external interrupts INT1 or INT2??

    3) I did see the following note in the data sheet and am wondering if this implies that the WDT is an interrupt flag and must be cleared before using any interrupt???

    "Interrupt flag bits are set when an interrupt condition occurs regardless of the state of its corresponding enable bit or the global
    interrupt enable bit. User software should insure the appropriate interrupt flag bits are clear prior to enabling an interrupt.
    This feature allows for software polling."

    LOW and GOTO don't generate CLRWDT instructions.
    <br>
    4) How does the use of the PAUSE statement insure that CLRWDT has been executed, whereas use of LOW or GOTO do not? I went through the instruction set in the data sheet and couldn't find anything that would indicate that.

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Turn the thing OFF

    1) How is a PICBASIC programmer supposed to know that the WDT must be kept clear during the Main loop of a program when using the INT2 external interrupt of the DT_INTS-18 include file? I went through the code/comments of DT_INTS-18 and couldn't find anything that advises that.
    Why would you be looking in DT_INTS to find out about the WDT?
    DT_INTS does nothing with the WDT, and your problem has nothing to do with INT2.
    It's resetting the processor because it's sitting in the main loop without clearing the WDT.

    2) Must the WDT be kept clear during Main loop when using other interrupts supported by DT_INTS-18 or just for the external interrupts INT1 or INT2??
    Same answer here ... The WDT has nothing to do with interrupts.
    3) I did see the following note in the data sheet and am wondering if this implies that the WDT is an interrupt flag and must be cleared before using any interrupt???
    There are no interrupt flags for the WDT. The WDT does not generate interrupts, it resets or restarts the processor.

    4) How does the use of the PAUSE statement insure that CLRWDT has been executed, whereas use of LOW or GOTO do not? I went through the instruction set in the data sheet and couldn't find anything that would indicate that.
    Anything that takes time like PAUSE, SERIN etc. will have CLRWDT's in it.

    HIGH LOW or GOTO are only 1 or 2 instructions.
    If it put CLRWDT's in every one of those ... it would fill 1/3 of the program space with CLRWDT's, and the Dog would be getting kicked so many times he'd start Biting.

    Unless you are using SLEEP mode with WDT wake-up, just turn the thing off.<br>
    DT

Similar Threads

  1. PICPROTO 18 Prototyping Board Examples
    By rick hardy in forum General
    Replies: 9
    Last Post: - 21st April 2008, 06:19
  2. Real Time Clock & Eeprom
    By smart_storm in forum General
    Replies: 8
    Last Post: - 17th February 2006, 20:03
  3. PIC16F62x 18 pin SMT breakout PCB
    By jdgrotte in forum Adverts
    Replies: 1
    Last Post: - 1st January 2004, 09:59

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts