0
\$\begingroup\$

I was wondering if its possible to convert the high frequency PWM output from a Beaglebone Green's PRU into an analog audio signal. I was looking at building a low pass filter and I was wondering if that is the right direction to go?

\$\endgroup\$
3
  • \$\begingroup\$ What quality audio? One or two channels? What sample rate? It's possible to do it with the PRU, but not necessarily with its eCAP module (Which is what I assume you mean when you refer to PWM). \$\endgroup\$
    – Mark
    Jun 11, 2016 at 1:18
  • \$\begingroup\$ By the way, if you are referring to the high-resolution PWM module (eHRPWM) and not the eCAP, then that is not a peripheral of the PRU, but a peripheral of the ARM, although it is accessible to the PRU through the OCP/Master Port. But it would have a fair amount of latency, which might negate the advantage of using the PRU. \$\endgroup\$
    – Mark
    Jun 11, 2016 at 1:29
  • \$\begingroup\$ And lastly, the Sitara has audio interface modules, the Multichannel Audio Serial Port (McASP), which hooks directly to almost all audio codecs. Very little additional hardware and even less additional software. \$\endgroup\$
    – Mark
    Jun 11, 2016 at 1:35

1 Answer 1

2
\$\begingroup\$

To answer your question, yes, this is a common solution in pin/feature constrained designs. But as Mark pointed out, there are some peripherals available to you with the Beaglebone board that may be better suited to this. Depending on the way you implement it, you will need to somehow continuously update the PWM signal (most likely at 44.1Kz if you want "CD quality" audio, lower rates will still work for most sounds) on a clock or timer. what you need to do is design your low-pass or reconstruction filter to minimize the signal from feeding through to your audio signal. Consider this picture. enter image description here

\$\endgroup\$
2
  • \$\begingroup\$ I decided to buy a usb to audio addapter. it was cheap and easy to use. \$\endgroup\$ Jun 12, 2016 at 23:47
  • \$\begingroup\$ Saw a +1 today (thanks!), so here's a more detailed thought on this if anyone finds useful: 1 - Tim(Rate Clk)+DMA+Tim(PWM) Method. Enable TimA as a regular event source, each timer overflow should generate an interrupt or DMA request. Either case should result in a value in memory being transferred to TimB as the Output Compare threshold value. Use a wave table for an NCO or from a sampled file to get sounds going. The trick is minimizing CPU utilization to avoid jitter and starving other tasks (This is what makes the OMAP PRUs so nice). And dont forget that anti-alias filter on the output! \$\endgroup\$
    – Luke Gary
    Oct 28, 2023 at 7:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.