ARM

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
wayne millard
Posts: 234
Joined: Thu May 31, 2007 2:18 pm
Has thanked: 7 times
Been thanked: 12 times

ARM

Post by wayne millard »

Hi Team,

I have just got Flowcode for ARM can you explain on how to use the timers to generate interrupt times.
examples would be good.
im using a ECIO for ARM

Thanks
Wayne

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: ARM

Post by Benj »

Hello Wayne,

With the timer0 interrupt you can set the prescaler to 1:32 and this gives you a whole number count value of 5850. Use an Int type variable in the interrupt routine to count up to 5850, When you get to this value reset to 0. Each time the count value is at 0 you know 1 second has elapsed.

Good way of incrementing count variable.

Calculation: count = (count + 1) MOD 5850
Decision: if (count = 0)

wayne millard
Posts: 234
Joined: Thu May 31, 2007 2:18 pm
Has thanked: 7 times
Been thanked: 12 times

Re: ARM

Post by wayne millard »

Hi Ben,

How is this time calculated to generate any time required.

Thanks,
Wayne

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: ARM

Post by Benj »

Hello Wayne,

Time is based on the number of interrupts if you are using the interrupt counting mechanism. This therefore depends on the rate of your interrupts and also the number of interrupts you count before you do something. eg 5850 interrupts @ prescaler 1:32.

Post Reply