PRU Encoder

Hello forum.

This is my first post on the forum. My name is Fabian and I am fairly new to programming for the Beaglebone. I know my way around C and have successfully realised an application for my work that reads the position of a quadrature encoder everytime an edge on a digital input is detected.
The program is good enough but will not be in the future since it is running on an already heavily loaded system. CPU load average is above 75%.
So the logical next step would be to off-load the task to one of the PRUs.
What I achieved so far:
Playing around with the example C code in Cloud9 and alter their functionallity slightly.
Also do I know that the robotcontrol library features a PRU encoder and I got that working, too.

What I want to achieve:

  • read the encoder position (A connected to P8_15 and B connected to P8_16) in the PRU when an edge is detected on P9_27
  • write these values into an array[80]
  • make this array available through the shared RAM
  • pick up the shared RAM in the user space for further processing

Has anyone done a similar thing. I especially the encoder reading in PRU?

I’m looking forward to your replies.

Thank you very much!