Page 1 of 1
How does calculation time in tmr1?
Posted: Mon Oct 30, 2017 12:58 pm
by Francisco Cabrera
Hi friends, I use flowcode 6, and the minimal time that allows me is 104 milliseconds for 20Mhz,
Is´t possible to fit Tmr1 for 100 milliseconds exact, or for 50 milliseconds?, how I can do it? please

...... regards
Re: How does calculation time in tmr1?
Posted: Mon Oct 30, 2017 1:29 pm
by medelec35
Hi Francisco,
Have you considered using timer 2 instead?
If you download the calculator app from
here
It should allow you to get a much more precise time.
Martin
Re: How does calculation time in tmr1?
Posted: Mon Oct 30, 2017 2:14 pm
by Francisco Cabrera
Thank you medelec, I am going to try it as you indicate me, and I will comment on the results....

Re: How does calculation time in tmr1?
Posted: Mon Oct 30, 2017 5:08 pm
by Francisco Cabrera
The calculator is fantastic, I like it very much thank you

...... So thank you again, so much.
But I have the same problem, in TMR1 Interruption could fit to 104 milliseconds, But I need 100 milliseconds..
in TMR2, With the calculator I can fit much easier the timer, but The interruption cannot overcome 76 milliseconds

I would have less precision that with TMR1
It is correct to say that,in tmr1 only it is possible to fit to the times that the software has predefined? And it is not possible to fit to a time as 100 milliseconds, and TMR2 I can adjust mas the times, but the maximum is 76 milliseconds, and I cannot overcome this time?
Re: How does calculation time in tmr1?
Posted: Mon Oct 30, 2017 5:41 pm
by medelec35
Hi Francisco,
Yes Its a great calculator.
What I would do is enter a frequency for 1KHz = 1ms:
Then if I want 50ms then that is 50 times 1ms
So then you can use a variable e.g TimerTick co count how many times interrupt has occurred.
E.g
You can then use a decision branch within the timer interrupt macro:
Code: Select all
If: TimerTick = 50 then for Yes branch: TimerTick = 0
Place what you want to do in the yes branch as at that point 50ms has just elapsed.
If You need further help then just post your Flowchart.
Martin
Re: How does calculation time in tmr1?
Posted: Mon Oct 30, 2017 5:55 pm
by Francisco Cabrera
Thank you very much, already it has explained it to me so well that already I do not have problems....
PD: Thank you from my heart.....