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 and RTCC ...RTCC delayed start?

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



Joined: 17 Dec 2005
Posts: 58

View user's profile Send private message

WDT and RTCC ...RTCC delayed start?
PostPosted: Tue Jan 02, 2007 12:23 pm     Reply with quote

Hi, Im using the WDT and RTCC in the same program. It appears that the WDT works fine, but the RTCC takes 6 seconds to start counting upon powering the PIC.(Chip part# is the 18F8722). I assume you cant use the scaler for both the WDT and Timer0/RTCC? If so is there a timer with an independent timer that could resolve the problem? thanks

--
Interupt code, and fuses pasted below...

/* RTCC Interrupt, timer0*/
#int_rtcc
void clock_isr(void) {
if(--int_count==0) {
++seconds;
fprintf(DebugPort,"%U",seconds);
int_count=INTS_PER_SECOND;
}
}


/* configuration */
setup_wdt(WDT_ON);
set_timer0(0);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_256|RTCC_8_BIT);
enable_interrupts(INT_RTCC);
enable_interrupts(GLOBAL);


/* fuses */
#FUSES WDT32768
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Tue Jan 02, 2007 1:11 pm     Reply with quote

A startup time of 6 seconds with your initialization is impossible, you have an error in your program somewhere. On program startup, what value do you int_count initialize with?
My guess is you initialize it to 0....
If yes, than your problem is in the line
Code:
if(--int_count==0) {
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