LoginSignup
3
2

More than 5 years have passed since last update.

Raspberry PiのPWMはアナログ音声出力と共用

Last updated at Posted at 2017-10-15

Raspberry PiのハードウェアPWMでサーボモータ… ではなく圧電サウンダ(ビープ音鳴らせるヤツ)を鳴らそうとしたところ,4極ジャックに繋いだスピーカからもビープ音が鳴るという奇妙な現象が.

日本語の情報が乏しいので英語の情報をあたると,PWMはアナログ音声出力と共用しているという記述を見つけました.

PWM and audio on RPi3 - Raspberry Pi Forums

Hardware PWM on the Pi uses the same peripheral as that used by the audio jack.
(意訳: ハードウェアPWMはオーディオジャックにも使われているぜ!)

現象の説明が付きます.
PWMと音声出力の両方を使用したい場合は,HDMIかUSBのオーディオデバイスを使うしかなさそうです.


Schematics - Raspberry Pi Documentation

公式の回路図を確認すると,4極ジャックの音声出力にはAUD_PWM0, AUD_PWM1がつながっていて,たしかに音声出力をPWMで実現しているようです.

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2