Page 1 of 1
Interupt Settings
Posted: Mon Sep 30, 2013 9:38 pm
by acestu
Hi,
I need to change a chart after 20 mins, so I am using an interrupt with Timer0, however I can't see how I set the period in the settings window, could somebody help me please ?
cheers
Acestu
Re: Interupt Settings
Posted: Mon Sep 30, 2013 10:19 pm
by Creative25
Hi,
This is what I did.
I use timer two.
Prescaler1:16
Postscaler1:5
Rollover value 32
At32MHz this gives a frequency of exactly 3125Hz
Then use I used counters to make seconds and minutes.
If it does not have to be so precise you can also use Timer0
I have atached the macro I used.
Best Regards:
Uli
Re: Interupt Settings
Posted: Mon Sep 30, 2013 10:34 pm
by acestu
Hi Creative,
Thanks for posting the Macro, I have imported it but I can't find it lol

, where does it end up ?
cheers
Acestu
Re: Interupt Settings
Posted: Mon Sep 30, 2013 10:53 pm
by medelec35
Hi Stuart,
I have posted a flowchart that toggles an output every 20minutes using a 19.6609MHz xtal.
With interrupt set at 75.00Hz, this means interrupt macro is accessed 75times evey second = once every 1/75 = 13.33ms
Its always best to choose the lowest interrupt frequency that is rounded to the nearest whole number.
75.00 is perfect!
Martin
Re: Interupt Settings
Posted: Mon Sep 30, 2013 11:05 pm
by acestu
Hi Martin,
Thanks for the chart, I will have a look at it now
cheers
Acestu
Re: Interupt Settings
Posted: Tue Oct 22, 2013 8:46 am
by Creative25
Hi Martin Thanks
I see the 19.6609MHz xtal gives some nice interrupt Frequencies and makes things easier.
I am using the Internal Oscillator at 32MHZ , the only Frequency I found that has no decimal point was 3125Hz. I realize it is slowing down the program unnecessarily.
Is there a simpler way to create a 1 Minute counter without External Oscillator, and without using such high interrupt frequency?
Best Regards:
Uli