A. Dumas wrote:
> Op 24-08-19 om 04:26 schreef Computer Nerd Kev:
>>
>> Actually it does have hardware PWM, see page 138:
>>
http://www.raspberrypi.org/wp-content/uploads/2012/02/BCM2835-ARM-Peripherals.p
df
>>
>> But this by no means implies that they designed it to work as a DAC
>> for audio output. It's also possible that the Pi doesn't actually use
>> the hardware PWM function for whatever reason and does it in software
>> - I haven't checked.
>
> Oh! My bad. I guess I didn't look further after reading that Pis aren't
> really suited to servo control due to timing issues with the
> multitasking operating system. I think I mistakenly concluded that that
> meant no hardware pwm.
>
> Maybe the problem with servo control isn't setting the pwm signal and
> letting it run without interference from system load (obviously there
> shouldn't be any with hardware pwm), but varying it with precise timing.
Yes, that's it exactly.
However there is this project that uses the DMA sub-system in the SoC
to change the PWM/GPIO configuration quickly enough to allow servos
and stepper motors to be controlled (well that's the claim, I haven't
tried it myself):
https://github.com/Wallacoloo/printipi/
More specifically:
https://github.com/Wallacoloo/printipi/tree/master/src/iodrivers
Also:
https://github.com/Wallacoloo/Raspberry-Pi-DMA-Example
Servos and stepper motor controllers take signals that are mainly
repeating though, audio requires constant updates so I'm guessing
that the DMA method might be less effective. I'm not sure whether the
audio driver for the pi uses that method or not.
Then of course there are the various real-time operating systems /
environments which allow software to run with the same reliable
timing as on a microcontroller. They might be quite practical for
servo control, but most users wanting nice audio probably also like
running standard Linux.
--
__ __
#_ < |\| |< _#
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|