Changing TRM setup "on the run"
Posted: Thu Mar 18, 2010 4:33 pm
I do beleave something IS wrong when changing the prescaling in a TMR-setup (at least with TMR0) while program is running in HW.
In two branches of my program I use different prescaler in setup of TMR0 - COUNTING mode have one setting of prescaler for TMR0 and RPM mode has another.
When changing from one mode to the other I DISABLE the TMR, change the prescaler and resume.
In HW the changing DO NOT take place - it seems like the TMR stops or can't be started again in the "new" mode.
I can choose between the two branches with a CHANGE-OVER switch.
If I leave the switch in the position where the timer now do NOT run and cut off power and connects again - then it works fine again - until I change the switch - then I have to cut/connect power again for it to work.
I beleave a "software reset" would do the job - can this be done in Flowcode ?
In two branches of my program I use different prescaler in setup of TMR0 - COUNTING mode have one setting of prescaler for TMR0 and RPM mode has another.
When changing from one mode to the other I DISABLE the TMR, change the prescaler and resume.
In HW the changing DO NOT take place - it seems like the TMR stops or can't be started again in the "new" mode.
I can choose between the two branches with a CHANGE-OVER switch.
If I leave the switch in the position where the timer now do NOT run and cut off power and connects again - then it works fine again - until I change the switch - then I have to cut/connect power again for it to work.
I beleave a "software reset" would do the job - can this be done in Flowcode ?