I will be using at least one programmable real-time unit (PRU) to send pulses to a stepper motor driver but before I begin, I am trying to lay out the structure of my programs.
I am using this library PRU Linux API for loading assembly code into the PRU instruction memory but there doesn't seem to be much documentation other then whats at that wiki and the source: github-pru-packageh
My c program will be calculating the position of the sun using an algorithm and executing the assembly/writing a pulse count to the PRU(s) data memory so they can just switch on/off a gpio at my desired frequency and for the number of pulses required to turn a stepper the appropriate number of steps. I am not even sure if this is an acceptable method but I am pretty new at this and it seems like a simple way to accomplish my task
My Questions regarding the library functions are:
- Is there a significant performance difference between using
prussdrv_pru_write_memoryto give the PRU(s) access to the pulse count?
- Would it be better halt the PRU assembly program after has completed the tasks for each pulse count then re-execute it with new values, or keep the PRU program running and poll for a new pulse count to be written in?
I plan to send a pulse count every 10 seconds or so.
Any suggestions on revisiting the whole structure and logic are welcome as well.