This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Linux/PRU-SWPKG: PRU PWM issue
Part Number: PRU-SWPKG
I am trying to send a PWM signal using PRU on my BeagleBone Black through a GPIO.
Currently I have rpmsg-pru and pruss driver working correctly and I can play with any firmware/hands on lab without issues.
I would like to be able to control the period/duty cycle of my signal over the rpmsg channel created.
I would like something like :
echo `GPIO:PERIOD:DUTYCYCLE:ENABLE` > /dev/rpmsg-pru31
Then the PRU firmware will parse this command and send the correct PWM signal to the corresponding GPIO.
Currently I can toggle GPIOs (LEDs) using a simple command :
echo `GPIO:ENABLE` > /dev/rpmsg-pru31
I had a look at but I did not understand quite the process. Do you have a simple PRU firmware that can achieve this behavior ?
We are glad that we were able to resolve this issue, and will now proceed to close this thread.
If you have further questions related to this thread, you may click "Ask a related question" below. The newly created question will be automatically linked to this question.
In reply to Nick Saulnier:
Hi Nick, Thank you for your reply,
For testing, I am trying to have PWM signals working on LEDs.
I am more interested in generating my PWM signal manually from the PRU.
Do you have some application note about this use case ?
In reply to user5835157:
an example using the PRU core to control the eCAP within the PRU-ICSS to output a PWM signal can be found in this TI design.
Notes: this e2e post might be helpful in interpreting the TI design. The firmware for PRU controlling eCAP is in sw/prupid_fw_1/PRU_IO_1.c of the software download. This example was written for Processor Linux SDK 2.0, so some parts of it will not work (e.g. RPMsg communication has gone through many updates. You can find the most recent examples of using RPMsg in the pru software support package at its git repo or in example-applications/pru-icss-xxx of your Processor Linux SDK). The PRU controlling eCAP part should not have changed, since that was based on register definitions, etc rather than drivers.
You can still use the PRU to control the PWMSS, but you would need to disable it in the Linux device tree file so that Linux did not try to mess with it while the PRU was controlling it. I did not have the experience to be super helpful at the time of this post, but Matthijs van Duin helped that customer properly initialize PWMSS when controlling it from the PRU. For a general example of controlling something outside the PRU-ICSS with the PRU, take a look at the examples/am335x/PRU_ADC_onChip example in the pru software support package EITHER at the git repo above, OR in Processor Linux SDK 5.1 or later.
For doing waveforms from the PRU itself, take a look at pru software support package examples/am335x/PRU_gpioToggle (which uses the PRU GPO pins, not the generic GPIO pins). A more complex example where the PRU implements a CLK, CS, SDI signals on GPO pins for a SPI protocol can be found at TIDA-01555 where the software is here. - it can also be found in example-applications/pru-adc-1.0 for AM335x Linux SDK 5.1 and later.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.