Hello,
I am trying to measure pulse width with PRU on AM3358 on beagelbone black via pru GPIO and getting some strange values from CYCLE counter.
I am using remoteproc driver to comunicate to ARM.
When I try to test this counter by this section bellow and then I send value to ARM for reading I get value 3423.
Which is strange when in datasheet it says that the CYCLE count will increment for every cycle during PRU is enabled.
I would expect value of CYCLE register to be 20000.
Do you know what could be the problem? Thank you
* Enable counter */
PRU1_CTRL.CYCLE = 0;
PRU1_CTRL.CTRL_bit.CTR_EN = 1;
__delay_cycles(20000);
PRU1_CTRL.CTRL_bit.CTR_EN = 0;
return PRU1_CTRL.CYCLE;