jeremiah
Joined: 20 Jul 2010 Posts: 1410
|
|
Posted: Fri May 05, 2017 6:39 pm |
|
|
What makes you think that the timer two period value isn't working? Is it because of the PWM? Various things can cause that. For example, on some dsPICs and PIC24s there is a SYNC option that must be specified for the PWM to work. If it isn't specified, changing the period can have no effect.
Have you just tested timer2 by itself? I bet if you do a quick program with just timer two and have the interrupt toggle an IO that it will work
| Code: |
#int_timer2
void timer2_isr(){
output_toggle(PIN_E0);
}
void main()
{
setup_timer2(TMR_INTERNAL | TMR_DIV_BY_8, 0x61A7);
enable_interrupts(INT_TIMER2);
enable_interrupts(GLOBAL);
while(TRUE);
}
|
See if changing the period parameter changes your pin toggling time. If it does, then you need to find the right PWM option most likely. |
|