Page 1 of 1

DI input counter problem

Posted: 27 Dec 2022, 15:26
by brahimdjadir
Hello Guys

I am trying to use DI to read pulse data from the sensor with frequency varying from 2Hz to 2Khz after configuring DI to counter mode.
I tested the module, and when checking the counter value it is always 0 until I disconnect the sensor it increments by 1.
I tried both falling and rising edge configurations and encounter the same problem.
I repeat the test with the MIO module with "PulseIn" mode and the counter works perfectly.
my question is what is the difference between the MIO pulse in mode and the input counter mode of the DI, and why the DI is not counting?

Re: DI input counter problem

Posted: 28 Dec 2022, 11:06
by u.biakoup
Hello Brahimdjadir,

please see this video tutorialhttps://revolutionpi.com/tutorials/video-tutorials/ Number #14. It's show how to use counter and Encoder for RevPi DIO. It will be the same for RevPi DI.
The maximum frequency resolution of the counter inputs for RevPi DI is 2 kHz (corresponding to 500 Hz encoder sequence).
Best Regards

Ulrich Kouatang Biakoup | Technical Support

Re: DI input counter problem

Posted: 28 Dec 2022, 17:22
by brahimdjadir
u.biakoup wrote: 28 Dec 2022, 11:06 Hello Brahimdjadir,

please see this video tutorialhttps://revolutionpi.com/tutorials/video-tutorials/ Number #14. It's show how to use counter and Encoder for RevPi DIO. It will be the same for RevPi DI.
The maximum frequency resolution of the counter inputs for RevPi DI is 2 kHz (corresponding to 500 Hz encoder sequence).
Best Regards

Ulrich Kouatang Biakoup | Technical Support
Thank you for your response Biakoup
I did not have a problem with DI usage and configuration I tested the DI module with a button and it increments without problem, When I try to read sensor data the DI counter does not increment so I try the pulse counter mode of the MIO module and it is working without problem I want to know what is the difference between DI counter mode and MIO pulse in mode and why the di does not count when using pulse sensor.

Re: DI input counter problem

Posted: 28 Dec 2022, 21:46
by nicolaiB
How does your signal looks like? What's the peak voltage? Do you have a scope at hand and can make a picture of the signal?

Nicolai