Multi input Pulsin in ASM non blocking
I am looking for an object in assembly, capable of measuring puls width on multiple inputs.
The ideal object should have a similar interface like the quadrature encoder object, i.e. a pinnumber, variable and count as in Quadrature Encoder v1.0.
The object should run in assembly for speed reasons. It should be non blocking, when no signal is connected by means of a timeout for example and continue with the next pin to measure. The associated variable should get a negative value (-1) signalling a timeout.
Not being too fluent in ASM, I hope that some one has a jump start object that I could use further
Henk
The ideal object should have a similar interface like the quadrature encoder object, i.e. a pinnumber, variable and count as in Quadrature Encoder v1.0.
The object should run in assembly for speed reasons. It should be non blocking, when no signal is connected by means of a timeout for example and continue with the next pin to measure. The associated variable should get a negative value (-1) signalling a timeout.
Not being too fluent in ASM, I hope that some one has a jump start object that I could use further
Henk
Comments
The multi-threading scheduler I have written might be quite suitable for your application. But it depends on what resolution and what precision, and how many inputs you might be looking for, and you have not provided any such details.
Typically the scheduler could handle something in the order of 2 inputs with 1 uSec resolution and typical accuracy of 1 uSec for speeds up to 100 Khz, or say 10 inputs with 1 uSec resolution and typical accuracy of 2 or so uSec for speeds up to 10 Khz. Lower speeds permit a larger number of inputs, and will bring up the typical accuracy. The resolution remains at 1 uSec regardless of speed or point count.
Cheers,
Peter (pjv)
I am measuring typically frequencies from 10 hz to 100 kHz. A resolution of 1 us should be sufficient in most cases. I would like to be able to connect up to for example 8 inputs.The current Pulsin in Spin is far too slow to leave time for other tasks in that cog and blocks if the signal drops away.
henk