PRU Getting Started, Frequency meter

Hi everybody,

After some test by using python or bonescript, it seems that i’m not able to measure the frequency of a square waveform faster than 150Hz.

So, i decided to work with PMU.

As i’m easy to work with Microchip microcontroller, i thought it will be easy to work with PMU for this little exercice.

The problem is that i find some information that used Assembly code, but example are old.

What are the up to date tool to use to start with PRU C developpement.

Is there a clear tutorial on which tool to install and step to follow to make the first programm using PMU?

I also tested by using Cloud9 but i dont’t have the PRU Exmple like on the videi in the PRU section of the BBB website.

Thanks a lot for your help cause i’m little bit stuck before any typing code :smiley:

Hi Florian!

Interpreters are slow, and sysfs access for GPIO input is also slow.

You can speed up your code by using libpruio for the GPIO access, but you’ll still have to deal with the real-time issue. The main CPU may get loaded by interrupt execution, which results in erroneous results.

But the ARM CPU has hardware support for frequency measurements. All of the three PWM subsystems contain a CAP module for that purpose (and a QEP module, which can measure the frequency on a single pin). Also the TIMER subsystems can measure the frequency (but configuration is more complex). This works up to a frequency of 50 MHz.

Check out the example pwm_cap to see how this works.

BR