Sylvia Dokua Kwakye wrote: > > Hello, > Sorry for the panicked title but I do help quickly. I am trying > to use timer1 to wake the PIC up from sleep after 1 minute. I am using the > PCM C compiler.The code compiles fine, but on the PIC, pin b0 never comes > on. (Timer1 has 32KHz external crystal osc.).If you are familiar with PCM's > compiler could you please take a look and help me out.Maybe, a fresh pair > of eyes will see something that I missed. Needless to say, I have been > staring at it for a while and have not been able to figure out the problem. > > #include <16C73.H> > #use Delay(Clock=4000000) > #define max_count 4; > byte the_count; > > #INT_TIMER1 > wake_1(){ > if( -- the_count != 0){ Try rewritting this as follows: --the_count; if(the_count != 0){ Sometimes it is best not to combine too many things on one line. The only thing I don't like is the space between the predecrement and the the_code. > sleep(); > } > else{ > output_high(pin_b0) > the_count = max_count; > } > } > > main(){ > the_count = max_count; > output_high(pin_b7); > set_timer1(0); > setup_timer_1(T1_EXTERNAL | T1_DIV_BY_8); > enable_interrupts(INT_TIMER1); > enable_interrupts(GLOBAL); > while(true); > } -- Neil Cherry http://home.att.net/~ncherry ncherry@worldnet.att.net