Hi!
Can anybody help me. I want to make a timer, not a wait. I am making a program where I am using Macro´s. But every 5 minute I want to set a flag so I am able to enable a Macro. I have already used one interrupt with timer0.
Is it possible to make a timer witch run wihtout interrupt, and please without C code?
Thanks i advance.
Best regard
Jørgen
Timer
Moderator: Benj
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Timer
Interrupts are used for a timer if your program is required to do other things whilst timing is carried out.
If you want a 5 minute non-interrupt timer, so program justs waits until time period has elapsed then try this way:
http://www.matrixmultimedia.com/mmforum ... =26&t=6967
If it was me and I would like to keep setting a flag every 5 minutes and performing other functions then I would use timer 1, since already using timer 0.
If you want a 5 minute non-interrupt timer, so program justs waits until time period has elapsed then try this way:
http://www.matrixmultimedia.com/mmforum ... =26&t=6967
If it was me and I would like to keep setting a flag every 5 minutes and performing other functions then I would use timer 1, since already using timer 0.
Martin
Re: Timer
If you already used timer0, you know the frequentie on witch this timer0 works. Just add a counter to it and place the routine you want to run every 5 minutes behind a "if" before this "if" you make a calculation "{LV} = Counter MOD {the number of times your timer0 is run in 5 minutes}" Now the "if" has to go true loop "yes" when the {LV} is 0
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Timer
That is a good point!Albert38 wrote:If you already used timer0, you know the frequentie on witch this timer0 works.
You said your already using int0, here is how you can utilise timer 0 to have a 2, 3 and 5 minute timer simultaneously. I have also included a Minute variable to set for how ever minutes you like.
You can also add as many different timers as you like.
- Attachments
-
- Different Timings LED Test1.fcf
- (8.5 KiB) Downloaded 359 times
Martin