View previous topic :: View next topic |
Author |
Message |
deepakomanna
Joined: 06 Mar 2007 Posts: 92 Location: Pune,India
|
prescaler of timer0 becomes zero ? |
Posted: Thu Mar 08, 2007 10:34 pm |
|
|
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
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
|
|
Posted: Thu Mar 08, 2007 10:49 pm |
|
|
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
|
timer0 problem not solved totally ? |
Posted: Thu Mar 08, 2007 11:54 pm |
|
|
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()
{
................
...............
} |
|
|
|