How does calculation time in tmr1?

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
User avatar
Francisco Cabrera
Posts: 47
Joined: Sat Mar 19, 2016 4:56 pm
Location: Canary Island
Has thanked: 23 times
Been thanked: 7 times
Contact:

How does calculation time in tmr1?

Post 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
Attachments
problem tmr1.jpg
problem tmr1.jpg (126.71 KiB) Viewed 4151 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: How does calculation time in tmr1?

Post 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
Martin

User avatar
Francisco Cabrera
Posts: 47
Joined: Sat Mar 19, 2016 4:56 pm
Location: Canary Island
Has thanked: 23 times
Been thanked: 7 times
Contact:

Re: How does calculation time in tmr1?

Post by Francisco Cabrera »

Thank you medelec, I am going to try it as you indicate me, and I will comment on the results.... :D

User avatar
Francisco Cabrera
Posts: 47
Joined: Sat Mar 19, 2016 4:56 pm
Location: Canary Island
Has thanked: 23 times
Been thanked: 7 times
Contact:

Re: How does calculation time in tmr1?

Post by Francisco Cabrera »

The calculator is fantastic, I like it very much thank you :D...... 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?
Attachments
timer2.jpg
timer2.jpg (110.77 KiB) Viewed 4133 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: How does calculation time in tmr1?

Post by medelec35 »

Hi Francisco,
Yes Its a great calculator.

What I would do is enter a frequency for 1KHz = 1ms:
1KHz T2.png
(67.68 KiB) Downloaded 1954 times
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

Code: Select all

TimerTick = TimerTick +1
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
Martin

User avatar
Francisco Cabrera
Posts: 47
Joined: Sat Mar 19, 2016 4:56 pm
Location: Canary Island
Has thanked: 23 times
Been thanked: 7 times
Contact:

Re: How does calculation time in tmr1?

Post by Francisco Cabrera »

Thank you very much, already it has explained it to me so well that already I do not have problems.... :D

PD: Thank you from my heart.....

Post Reply