[SOLVED] Need help in setting up precise timer 2 in PIC18F4550 1ms

Status
Not open for further replies.

john blue

Advanced Member level 3
Joined
Jun 7, 2007
Messages
821
Helped
213
Reputation
430
Reaction score
204
Trophy points
1,323
Activity points
4,749
// settings to configure Fosc to be 16MHz
#pragma config FOSC = HSPLL_HS// INTOSC_EC
#pragma config PLLDIV = 5
#pragma config CPUDIV = OSC4_PLL6

PR2 = 249;

OpenTimer2(TIMER_INT_ON & T2_PS_1_16 & T2_POST_1_1);

Based on the code above, i should get 1ms but i am getting 1.6ms. I hope someone can help me out. Thanks in advance.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…