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

how to setup WDT for this program (12F675)

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



Joined: 09 Aug 2007
Posts: 82
Location: TN, India

View user's profile Send private message Send e-mail

how to setup WDT for this program (12F675)
PostPosted: Tue Feb 26, 2008 11:07 pm     Reply with quote

hello,

how to setup the WDT for below program...

Code:
#include <12F675.h>
#device adc=8
#use delay(clock=4000000)
#fuses NOWDT,INTRC_IO, CPD, PROTECT, NOMCLR, PUT, BROWNOUT
#byte OSCCAL=0x90
#define GP0 PIN_A0
#define GP1 PIN_A1
#define GP2 PIN_A2
#define GP3 PIN_A3
#define GP4 PIN_A4
#define GP5 PIN_A5
//========================

#use fast_io(a)

#byte ADCON0 = 0x1F
#byte ANSEL = 0x9F
#byte CMCON = 0x19

#rom 0x3ff = {0x3470} // input the calibration code

int rtcc=0,seconds=0;
#int_RTCC
RTCC_isr()
{
   rtcc++;
   if (rtcc == 250)
   {
   seconds++;
   rtcc=0;
   }
    if (seconds==5)
    {
    output_HIGH(GP0);
    seconds=0;
    }
}

void main()
{

ADCON0 = 0; // ADC off
ANSEL = 0; // GPIO pins 0,1,2 and 4 set to all digital
CMCON = 7; // Comparators off

set_timer0(0);
setup_timer_0(RTCC_INTERNAL|RTCC_8_BIT|RTCC_DIV_16);
enable_interrupts(INT_RTCC);
enable_interrupts(GLOBAL);
 
set_tris_a(0b111110); //GP0 output
output_low(GP0);
while(1) {
  }

}
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Feb 26, 2008 11:50 pm     Reply with quote

You should try to do it yourself first. Then if you have problems, ask a
question.

Look at these CCS example files:
Quote:

c:\Program Files\picc\Examples\Ex_wdt.c
c:\Program Files\picc\Examples\Ex_wdt18.c
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