pjueon / JetsonGPIO

A C++ library that enables the use of Jetson's GPIOs
MIT License
285 stars 102 forks source link

Max interrupt frequency #77

Closed albertfaromatics closed 2 years ago

albertfaromatics commented 2 years ago

What's the maximum interrupt frequency on a pin the library allows? I'm trying to control a DC motor with encoder, with an encoder frecuency of about 20KHz but I'm not achieving the expected results.

pjueon commented 2 years ago

Do you mean the frequency of the PWM? or just manually setting the pin to HIGH/LOW repeatedly? I'm guessing it's not PWM because I'm using jetson nano and I could get 40kHz and 60kHz output with the PWM pin. (This could be changed depending on your jetson model and the pin you're using.)

And I believe that the library doesn't intentionally limit the frequency at the software level. What does limit the frequency is probably the hardware.

Of course, the implementation of the library could be optimized better but I don't believe that's gonna happen in the near feature.

pjueon commented 2 years ago

Sorry, I confused the "interrupt frequency" with "output frequency".

But the thing is, there is no intentional limit for the interrupt frequency in the source code.

78 seems to be similar issue. If you need further discussion, let's continue on #78.

Closing this issue.