TIMER 2
Posted: Tue May 31, 2022 1:05 pm
Hi all
id like to know if possible if i could alter the output of timer 2 within software, i have a port toggling at 40 hz but would like to alter this frequency to say 49 hz for the first 10 seconds of operation then revert back to 40 hz, at this point frequencys are examples i realise i need to adjust prescaler, postscaler and roll over but how if at all do i achive this ??? i did try using a c box with PR2 = 210-1 To change the rollover this gives a frequency of 49hz which is correct using a decision box if less than 10 seconds however it would not go back to 40hz after 10 seconds but the c code must be right as in hardware i got 49 hz I also changed timer tick to 99 as per rollover change
ive added a simple flow chart thanks in advance
bob
id like to know if possible if i could alter the output of timer 2 within software, i have a port toggling at 40 hz but would like to alter this frequency to say 49 hz for the first 10 seconds of operation then revert back to 40 hz, at this point frequencys are examples i realise i need to adjust prescaler, postscaler and roll over but how if at all do i achive this ??? i did try using a c box with PR2 = 210-1 To change the rollover this gives a frequency of 49hz which is correct using a decision box if less than 10 seconds however it would not go back to 40hz after 10 seconds but the c code must be right as in hardware i got 49 hz I also changed timer tick to 99 as per rollover change
ive added a simple flow chart thanks in advance
bob