Page 1 of 1

ARM

Posted: Tue Apr 12, 2011 10:20 pm
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

Re: ARM

Posted: Wed Apr 13, 2011 9:55 am
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)

Re: ARM

Posted: Wed Apr 13, 2011 12:45 pm
by wayne millard
Hi Ben,

How is this time calculated to generate any time required.

Thanks,
Wayne

Re: ARM

Posted: Wed Apr 13, 2011 3:16 pm
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.