I am looking to set up inputs from sensors producing pulses between 3 and 3000/sec.
However I cant seem to find an easy way in Flowcode to set timer 0 and timer 3 as counters usingT0CKI and T13CKI and a 1second interupt. read values and reset.
Is there a Counter function in Flowcode 6? If not does it mean I have to make my own component?
Counter
Moderator: Benj
Forum rules
Only feature requests will be considered here. General questions should not be posted in this forum.
Only feature requests will be considered here. General questions should not be posted in this forum.
-
- Posts: 93
- Joined: Mon Sep 23, 2013 4:33 pm
- Has thanked: 5 times
- Been thanked: 6 times
- Contact:
- JonnyW
- Posts: 1230
- Joined: Fri Oct 29, 2010 9:13 am
- Location: Matrix Multimedia Ltd
- Has thanked: 63 times
- Been thanked: 290 times
- Contact:
Re: Counter
Hello. Maybe it is my lack of knowledge in this area, but can you give more details of what you are after?
If you require interrupts to be set up to sample a sensor on a timeslice, there is no direct facility to do this, but it should be easy enough to do in Flowcode. You could write a component to do this, true, but this would only be much use if you were to re-use the code in multiple projects.
The more info the more we can help - how does the program decide what gap between the samples, etc?
Jonny
If you require interrupts to be set up to sample a sensor on a timeslice, there is no direct facility to do this, but it should be easy enough to do in Flowcode. You could write a component to do this, true, but this would only be much use if you were to re-use the code in multiple projects.
The more info the more we can help - how does the program decide what gap between the samples, etc?
Jonny
-
- Posts: 93
- Joined: Mon Sep 23, 2013 4:33 pm
- Has thanked: 5 times
- Been thanked: 6 times
- Contact:
Re: Counter
Sorry for delay,
I require pulses from two sensors to be counted, 2 16bit counters would do the job, As I require can output I have chosen the 18F2680 which has four timers. 2 of the timers can be set as 16 bit counters on pins T0CKI and T3CKI, and use timer 2 for 1 second interupts to read both counters.I am not sure wether to put an RTC chip for the one second interupt or set timer2.
But a counter component would be handy for a lot of applications.
![Question :?:](./images/smilies/icon_question.gif)
I require pulses from two sensors to be counted, 2 16bit counters would do the job, As I require can output I have chosen the 18F2680 which has four timers. 2 of the timers can be set as 16 bit counters on pins T0CKI and T3CKI, and use timer 2 for 1 second interupts to read both counters.I am not sure wether to put an RTC chip for the one second interupt or set timer2.
But a counter component would be handy for a lot of applications.
![Question :?:](./images/smilies/icon_question.gif)
The older the boy the bigger the toy
- 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: Counter
Hello,
This example program might be useful.
http://www.matrixmultimedia.com/mmforum ... 974#p37282
We could potentially make a counter component or something along these lines in v6 as your right it would be handy. I'll add it to the list.
This example program might be useful.
http://www.matrixmultimedia.com/mmforum ... 974#p37282
We could potentially make a counter component or something along these lines in v6 as your right it would be handy. I'll add it to the list.
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