How does calculation time in tmr1?

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

Moderator: Benj

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?

Postby Francisco Cabrera » Mon Oct 30, 2017 12:58 pm

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 419 times

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 7223
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 1942 times
Been thanked: 2837 times
Contact:

Re: How does calculation time in tmr1?

Postby medelec35 » Mon Oct 30, 2017 1:29 pm

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
These users thanked the author medelec35 for the post:
Francisco Cabrera (Mon Oct 30, 2017 2:14 pm)
Rating: 5.88%
 
If your hardware is not working as expected, try looking here first:
http://www.matrixmultimedia.com/mmforum ... =26&t=6936

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?

Postby Francisco Cabrera » Mon Oct 30, 2017 2:14 pm

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?

Postby Francisco Cabrera » Mon Oct 30, 2017 5:08 pm

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 401 times

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 7223
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 1942 times
Been thanked: 2837 times
Contact:

Re: How does calculation time in tmr1?

Postby medelec35 » Mon Oct 30, 2017 5:41 pm

Hi Francisco,
Yes Its a great calculator.

What I would do is enter a frequency for 1KHz = 1ms:
1KHz T2.png
1KHz T2.png (67.68 KiB) Viewed 397 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
These users thanked the author medelec35 for the post (total 2):
Francisco Cabrera (Mon Oct 30, 2017 5:55 pm) • Benj (Tue Oct 31, 2017 12:57 pm)
Rating: 11.76%
 
If your hardware is not working as expected, try looking here first:
http://www.matrixmultimedia.com/mmforum ... =26&t=6936

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?

Postby Francisco Cabrera » Mon Oct 30, 2017 5:55 pm

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.....
These users thanked the author Francisco Cabrera for the post (total 2):
Benj (Tue Oct 31, 2017 12:57 pm) • medelec35 (Tue Oct 31, 2017 4:11 pm)
Rating: 11.76%