CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

WDT non working on PIC16F777 (PCM Ver. 3.245)

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Dickperez
Guest







WDT non working on PIC16F777 (PCM Ver. 3.245)
PostPosted: Tue Aug 18, 2009 5:02 pm     Reply with quote

I've not been able to make WDT to work (at the debugger level it never produces a Reset, however it compiles with no errors). Can you take a look and give a suggestion on what I'm doing wrong or missing to do? (I've just included the relevant program portions).
Thanks in advance.
Code:

#include <16F777.H>

#fuses INTRC, WDT, NOPROTECT, PUT, NOBROWNOUT, MCLR,
#use delay(clock = 8000000)   
.
.
.
void main()
{
//   Inicializacion del procesador

switch ( restart_cause() )
   {
      case WDT_TIMEOUT:
      {
         goto reset1 ;
         break;
      }
      case MCLR_FROM_RUN:
      {
         goto reset1 ;
         break;
      }
   }
.
.
.
SETUP_WDT(WDT_576MS);
.
.
.
for (;;)                     {
      RESTART_WDT();
      
       all_program_functions()
                 }
}
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Aug 18, 2009 5:07 pm     Reply with quote

If you call restart_wdt() in your main loop, you won't get a WDT reset.
Dickperez
Guest







WDT non working on PIC16F777 (PCM Ver. 3.245)
PostPosted: Tue Aug 18, 2009 5:12 pm     Reply with quote

I´ve also tried without the RESTART_WDT() command, and I got the same results.
Are there any reports of bugs for this MCU with the PCM version I´m using?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Aug 18, 2009 5:24 pm     Reply with quote

Quote:
at the debugger level it never produces a Reset, however it compiles with no errors).

I noticed you're trying to run this test under the Debugger.
The Microchip ICD2 Help file says:
Quote:
Debugger Limitations
The Watchdog Timer (WDT) cannot be used when debugging.

The CCS ICD-U40 will likely have the same limitation.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group