How do you start a timer after its already been stopped ?
timer1 is turned on through initial setup_timer1()
timer1 is stopped using setup_timer1() function
but how do you get timer1 to turn back on. Set it up again ? Is there a bit I can turn on ?
efox
Joined: 24 May 2006 Posts: 14
Posted: Sat Mar 07, 2009 10:32 pm
probably found my own indirect answer for this...
but if you want to turn a timer back on
setup_timer_1(!T1_DISABLED)
Though if there is another way or explanation, love to hear it.
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Sat Mar 07, 2009 10:55 pm
Quote:
but if you want to turn a timer back on
setup_timer_1(!T1_DISABLED)
You shouldn't make an assumption like that. The values that can be
used for parameters for the Timer functions are listed in the .H file
for your PIC. Don't use anything else. For example, in 16F877.h
these two constants should be used to disable and enable Timer1:
Code:
#define T1_DISABLED 0
#define T1_INTERNAL 0x85
When you enable it, you also have the option to OR it with a clock divisor
value, as given in the .h file.
Guest
Posted: Sun Mar 08, 2009 1:09 am
ya im noticing a lot of errors in my 'logic'
CCS is really good with its functions and optimization, but i find the headers a bit confusing.
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