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
ARM
Moderator: Benj
- 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
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)
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)
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- 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
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel