Counter

Please add any feature requests for Flowcode version 6 here

Moderator: Benj

Forum rules
Only feature requests will be considered here. General questions should not be posted in this forum.
Post Reply
JFinlayson
Posts: 93
Joined: Mon Sep 23, 2013 4:33 pm
Has thanked: 5 times
Been thanked: 6 times
Contact:

Counter

Post by JFinlayson »

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?
The older the boy the bigger the toy

User avatar
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

Post by JonnyW »

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

JFinlayson
Posts: 93
Joined: Mon Sep 23, 2013 4:33 pm
Has thanked: 5 times
Been thanked: 6 times
Contact:

Re: Counter

Post by JFinlayson »

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.

:?:
The older the boy the bigger the toy

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: Counter

Post by Benj »

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.

Post Reply