I am using the system events from PRU0 to trigger ADC conversions.
ADC conversions are triggered by system event #16 of PRU0, and routed via PRU INTC to TSC_ADC event. With this setup I can trigger an ADC conversion by writing __R31 = 0x20 inside the PRU0. Everything works but I need to take care of a minimum delay between sytem events, otherwise the ADC conversion is not properly triggered.
ADC clock is 24MHz (test setup is a beaglebone black), and ADC_CLKDIV=0, STEPDELAY of TSC_ADC is set to 0x08000000, so ADC speed is not the cause (I verified the timing and as expected I can see the ADC conversion takes less than 2µs from trigger to EOC interrupt)
The following code works (__delay cycles causes 40µs delay between ADC triggers), and gives the results of 2 ADC conversions in ADC FIFO0 as expected:
__R31 = 0x20; // generate System event #16, routed to ext_hw_event of TSC_ADC
__delay_cycles(8000);
__R31 = 0x20;
However when I reduce the delay value to 2000 (10µs delay between ADC triggers), most of the time (>99%) only the first ADC conversion is triggered. I get a conversion result about 2µs after the first system event, but no second conversion result after the second system event.
Is there any limitation for subsequent SW triggered system events in the PRU? TRM paragraph 4.4.1.2.2 states that generating a system event by R31 "creates a pulse on the output of the corresponding pr1_pru_mst_intr[x]_intr_req INTC system event". If the width of this pulse was in the range of some 10s of µs this would explain the behaviour, but the length of the pulse is not specified anywhere. Another cause could be the width of the generated pulse by the PRU INTC at the ext_hw_event to TSC_ADC, but this is also not mentioned anywhere.
What could be the cause for the limitation of subsequent ADC conversions?