This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PRU "Interrupt"/"event" from eGPIO, edge trigger

Hello there,

I'm building a PRU application, to receive data from an ADC. This ADC has a left/right clock signal, which is a square wave signal with a duty cycle of roughly 50%. This signal is connected to an enhanced GPIO input pin. I want to make the PRU sleep (or some kind of inactive, in order to save power) while waiting for an edge on this signal. So I used the PRU command SLP 1 , and registers the GPIO for the input signal, in the wakeup enable (WAKEUP_EN) register, to make the PRU sleep between the edges of the signal. 

My problem is: When the input signal in high, the PRU seems to instantly wakeup after SLP 1 is called. Is there a way I can make the SLP command only wake the PRU up on an edge, or edit the input signal to generate pulses on its edges? Maybe through the interrupt controller? The delay from an edge on the input signal to execution on PRU is critical, so I have to use the enhanced GPIOs.

I'm using the BeagleBone Black (AM335x 1GHz ARM® Cortex-A8), running Linux beaglebone 3.8.13-bone47.

I hope my question is clear enough, I'm quite new to this stuff.

  • Hi,

    From what I see in the AM335X TRM Rev. L the only PRI GPI pin that is edge-sensitive is CLOCKIN (bit r31_16). See section 4.4.1.2.3.2 for details.
  • Thank you very much for your reply.

    I have tried setting the input signal at pr1_pru0_pru_r31_16, but I still see the same behavior.
    I'm not sure how to only use the edges of this signal at the Wakeup events. It seems that the CLOCKIN is "programmable through the PRU-ICSS CFG register space.", but I don't see how I'll be able to use this, as the wakeup events. Maybe you some general suggestions about this?
  • Martin,

    I've spoken with a PRU hardware colleague of mine and we don't believe that the edge triggered wakeup is possible in the PRU. As you've seen, if any of the R31 signals that correspond to an enabled wakeup bit in the WAKEUP_EN register are high, then the PRU will return from SLP.

    One suggestion would be to poll on the R31 input of the clock until it becomes low, and then call the SLP 1 instruction. This would obviously only allow for sleeping through roughly half the clock cycle, but without some external circuitry to turn your clock into a pulse I'm afraid its the best we could do.

    Jason Reeder

  • That is fine, I was just researching possibilities.. Thank you very much for the reply :)