Hal_pru_generic was meant to be generic, not fast, which is why I put
"generic" in the name. :) I had generally intended to make a "fast"
version, but never needed to (the existing PRU logic can drive my 3D
printer step/dir drivers faster than they can accept pulses already!).
Probably the first step for improved performance would be getting the
HAL driver to support multiple PRUs, either using one driver, or perhaps
by making the driver an icomp so you could run multiple instances. This
would let you divide up the work across the PRUs so you could run a
faster cycle rate on each one since it's not doing all the work.
Next would be crafting some new PRU "tasklets" that are less generic
than what's currently implemented. Options would be to only support PRU
direct IO, only support one or two GPIO banks instead of 4+, possibly
unroll some loops to avoid branch/jump (eg: make a 5 stepgen tasklet
instead of using the stepgen tasklet 5 times). This might also be the
easiest solution if you think you can get the performance you need out
of a single PRU.
The final step would be dropping most or all of the existing PRU tasklet
framework and writing something that specifically does *JUST* what you
need, and spread that across several PRUs, eg: Run a 2 stepgen task
across 3 PRUs and get 6 step/dir outputs.
>>
cha...@steinkuehler.net <javascript:>
>>
>
--
Charles Steinkuehler
cha...@steinkuehler.net