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

prescaler of timer0 becomes zero ?

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



Joined: 06 Mar 2007
Posts: 92
Location: Pune,India

View user's profile Send private message AIM Address Yahoo Messenger

prescaler of timer0 becomes zero ?
PostPosted: Thu Mar 08, 2007 10:34 pm     Reply with quote

hi,
i am using MPLAB V7.5 & CCS PCM C Compiler, Version 3.249, 34534.
i am facing one problem plz let me soluton over it, the problem is,

SETUP_TIMER_0(RTCC_DIV_64); // prescaler 1:64
SETUP_TIMER_0(RTCC_INTERNAL); // start timer0

Confused
by doing this,the prescler bits PS0:PS2 Becomes zero.
plz tell me what should i to do ?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Mar 08, 2007 10:49 pm     Reply with quote

Do this:
Code:
SETUP_TIMER_0(RTCC_INTERNAL | RTCC_DIV_64);

It's in the manual.
deepakomanna



Joined: 06 Mar 2007
Posts: 92
Location: Pune,India

View user's profile Send private message AIM Address Yahoo Messenger

timer0 problem not solved totally ?
PostPosted: Thu Mar 08, 2007 11:54 pm     Reply with quote

PCM programmer wrote:
Do this:
Code:
SETUP_TIMER_0(RTCC_INTERNAL | RTCC_DIV_64);

It's in the manual.


ok, thanks.
but i want to start timer0 after some initialisation
i.e.
main()
{
..........some variables decleration.............
init_CPU();
.........other function() decleration..........
.....& here i want to start timer0....
SETUP_TIMER_0(RTCC_INTERNAL); // start timer0
while(TRUE)
{
.................
..............
}

}

void init_CPU()
{
...........other initialition.....
SETUP_TIMER_0(RTCC_DIV_64); // prescaler 1:64
........
.........

}

#int_timer0
timer0 isr()
{
................
...............
}
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