I am trying to send a pulse of width 100 clock cycles using PRU on my BeagleBone Black through P8_11. In my main.c file I have added a callback for pin P8_10 for a rising edge.
If I disable the outer loop and send the pulse only once, I am not registering anything in my callback function. If the outerloop is enabled, the program freezes.
Is there anything wrong in my approach? Are there any working examples trying to do the same?
/* PRU PWM CODE
Send pulse of width 100 clock cycles every 1000 clock cycles. */ // Start of program .origin 0 // Delay in between high and low mov r1, 10 // Number of pulses to send mov r2, 1000 // Loop here outloop: // Set high set r30, r30, 15 // wait for sometime here delay: sub r1, r1, 1 qbne delay, r1, 0 // Set low clr r30, r30, 15 sub r2, r2, 1 qbne outloop, r2, 0 // We are done, send interrupt mov r31.b0, 19 + 16 // Halt, otherwise PWM runs continuously halt