timer 3 is never getting executed? must be something simple
Posted: Sat Dec 03, 2005 6:19 pm
This code is for a pic18f4455 with 4 built in timers and one ccp module.
I'n trying to use timer 3 as a simple counter, but when i noticed it wasnt counting I added a printf.. and nothing shows up. so I must have messed up somewhere. Anyone have an idea of what i did wrong,
setup_ccp1(CCP_CAPTURE_RE); // Configure CCP1 to capture rise
setup_timer_3(T3_DIV_BY_8);
enable_interrupts(INT_TIMER3);//constantly counting but only used for RPM
enable_interrupts(INT_CCP1); // Setup interrupt on falling edge
enable_interrupts(INT_TIMER1);//constantly counting but only used for RPM
enable_interrupts(GLOBAL);
main loop....
Nick Guest
Posted: Sat Dec 03, 2005 7:11 pm
I moved to timer_0 and it worked, i must be missing a concept here?
Nick
drh
Joined: 12 Jul 2004 Posts: 192 Location: Hemet, California USA
Posted: Sat Dec 03, 2005 9:20 pm
Change:
setup_timer_3(T3_DIV_BY_8);
To:
setup_timer_3(T3_INTERNAL | T3_DIV_BY_8); _________________ David
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