Hello,
I'm trying to generate pulses with the fixed duration by PRU on R30 pins on my BBB. I use clpru 2.1.1 for it. Here is my code for polling needed duration:
volatile uint32_t i, m;
..............
pin_high(PIN_GEN);
for (i = 0; i < m; i++);
pin_low(PIN_GEN);
............
void pin_high(uint8_t n) {
__R30 = __R30 | (1 << n);
}
void pin_low(uint8_t n) {
__R30 = __R30 & ~(1 << n);
}
in fact when I want to get 5 us pulse I get it but sometimes pulse is longer (6 or even 7 us).
for some reasons EPWM is not suitable for my task.
I thought that the PRU is jitterless. What is the possible of such behavior?