1

I'm curious if the GPIO pins on a Raspberry Pi are capable of acting as a counter for TTL like signal inputs. I am interested in independently counting on six channels/pins, where the input signal that I would like to count is a 3.3 V (for greater than 1 kOhm, which the GPIO inputs seem to be) rectangular pulse with 5-50 us width. I'd like to count signals with a frequency of up to 1 kHz, but at least 100 Hz.

Based on this link it seems possible, using the pigpio c-module: Count RPM/Frequency/Pulses on GPIO ports (Maximum?)

I'd just like to verify that counting at 0.1-1 kHz can occur on multiple GPIO pins simultaneously with a Raspberry Pi, or if not, could a better board/computer be suggested.

migrated from electronics.stackexchange.com Sep 28 '15 at 21:55

This question came from our site for electronics and electrical engineering professionals, students, and enthusiasts.

1

The Pi is capable of doing what you want.

http://abyz.me.uk/videos/events.webm shows signals on GPIOs 2 through 26 being captured/displayed.

The only thing to be careful about is the minimum pulse width. By default my pigpio library samples at 5 µs so it would be best to ensure edges are at least say 10 µs. However you could boost the sampling rate to 2 µs so ensuring that 5 µs edges will be detected.

There are two C examples of simple (multiple GPIO) frequency counters at http://abyz.me.uk/rpi/pigpio/examples.html.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.