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
How does calculation time in tmr1?
Moderator: Benj
- Francisco Cabrera
- Posts: 47
- Joined: Sat Mar 19, 2016 4:56 pm
- Location: Canary Island
- Has thanked: 23 times
- Been thanked: 7 times
- Contact:
-
- 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?
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
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
- 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?
Thank you medelec, I am going to try it as you indicate me, and I will comment on the results....
- 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?
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?
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 (110.77 KiB) Viewed 4133 times
-
- 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?
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:
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
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
Code: Select all
TimerTick = TimerTick +1
Code: Select all
If: TimerTick = 50 then for Yes branch: TimerTick = 0
If You need further help then just post your Flowchart.
Martin
Martin
- 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?
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.....
PD: Thank you from my heart.....