Interupt Settings

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

Moderator: Benj

Post Reply
User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times
Contact:

Interupt Settings

Post 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 ?
Interupt1.png
(12.48 KiB) Downloaded 2588 times
cheers
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

Creative25
Posts: 323
Joined: Tue Sep 06, 2011 2:54 am
Has thanked: 166 times
Been thanked: 26 times
Contact:

Re: Interupt Settings

Post 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
Attachments
seconds.fcm
(3.44 KiB) Downloaded 241 times

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times
Contact:

Re: Interupt Settings

Post by acestu »

Hi Creative,

Thanks for posting the Macro, I have imported it but I can't find it lol :lol: , where does it end up ?

cheers
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

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

Re: Interupt Settings

Post 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
Attachments
20mins.fcfx
(8.2 KiB) Downloaded 262 times
Martin

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times
Contact:

Re: Interupt Settings

Post by acestu »

Hi Martin,

Thanks for the chart, I will have a look at it now :D

cheers
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

Creative25
Posts: 323
Joined: Tue Sep 06, 2011 2:54 am
Has thanked: 166 times
Been thanked: 26 times
Contact:

Re: Interupt Settings

Post 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

Post Reply