DMAってなんだろう?

  • このエントリーをはてなブックマークに追加

CPU・MPUのブロック図やデータシートには必ず「DMA」というものが出てきます。

DMA = Direct Memory Access

直截メモリにアクセス!ってことです。

 

普通、メモリというのはCPUが触ります。

プログラムでメモリにデータを書き込んだり、読み込んだりします。

プログラムを実行するだけの機械ならこれでOKです。

 

が、現実のマイコンというのはいろんなことをしています。

例えば、Aと通信をしながらBとの通信に必要なデータを組み立てている場合を考えてください。

Bの通信に必要な計算を一生懸命しているのに、Aと通信している周辺機器から「1バイト送ったよ。次のデータ頂戴」と呼び出されるわけです。

その度にBの計算を中断して、Aのデータが入っているメモリを読み込んでAと通信している周辺機器に渡してあげる必要があるわけです。

これは結構無駄です。

 

DMAというのはそういった処理を自動化してくれる機能です。

最初にプログラム(CPU)から「こういうデータをこういう風に送ってね」と設定しておくと、あとは勝手にやってくれるわけです。

例えば先程の例では、「周辺機器から次のデータを求められたら次のバイトのデータを転送するように」とかできます。

 

DMA自体はメモリコピー全般に使えるように設計されているため、他にもいろいろ使いみちがあります。

・CPUと無関係に大量のデータをコピーしたい

・CPUが低消費電力状態で低速クロックで動いている時でも、データのコピーをしたい(DMAはCPUと無関係に動作するので)

etc…

この辺はハードウェア設計者より、実際に組込みソフトウェアを作っている人のほうが詳しいはずです(汗;

 

ここまで書いといて何ですが、DMAは知識として必要ですが、これによってハードウェアの組み方が変わることは普通ありません。

なので、回路設計するときはぶっちゃけあんまり関係ありません。(汗;

 

以上、小田切でした。

  • このエントリーをはてなブックマークに追加

Warning: extract() expects parameter 1 to be array, string given in /home/kisukunanato/kairo-consulting.com/public_html/blog/wp-content/themes/xeory_base/lib/functions/bzb-functions.php on line 314

Warning: Illegal string offset 'title' in /home/kisukunanato/kairo-consulting.com/public_html/blog/wp-content/themes/xeory_base/lib/functions/bzb-functions.php on line 318

Warning: Cannot assign an empty string to a string offset in /home/kisukunanato/kairo-consulting.com/public_html/blog/wp-content/themes/xeory_base/lib/functions/bzb-functions.php on line 318

Warning: Illegal string offset 'content' in /home/kisukunanato/kairo-consulting.com/public_html/blog/wp-content/themes/xeory_base/lib/functions/bzb-functions.php on line 320

Warning: Cannot assign an empty string to a string offset in /home/kisukunanato/kairo-consulting.com/public_html/blog/wp-content/themes/xeory_base/lib/functions/bzb-functions.php on line 320

Warning: Illegal string offset 'button_text' in /home/kisukunanato/kairo-consulting.com/public_html/blog/wp-content/themes/xeory_base/lib/functions/bzb-functions.php on line 322

Warning: Cannot assign an empty string to a string offset in /home/kisukunanato/kairo-consulting.com/public_html/blog/wp-content/themes/xeory_base/lib/functions/bzb-functions.php on line 322

Warning: Illegal string offset 'button_url' in /home/kisukunanato/kairo-consulting.com/public_html/blog/wp-content/themes/xeory_base/lib/functions/bzb-functions.php on line 323

Warning: Cannot assign an empty string to a string offset in /home/kisukunanato/kairo-consulting.com/public_html/blog/wp-content/themes/xeory_base/lib/functions/bzb-functions.php on line 323

Warning: Illegal string offset 'button_cvtag' in /home/kisukunanato/kairo-consulting.com/public_html/blog/wp-content/themes/xeory_base/lib/functions/bzb-functions.php on line 324

Warning: Cannot assign an empty string to a string offset in /home/kisukunanato/kairo-consulting.com/public_html/blog/wp-content/themes/xeory_base/lib/functions/bzb-functions.php on line 324

Warning: Illegal string offset 'image' in /home/kisukunanato/kairo-consulting.com/public_html/blog/wp-content/themes/xeory_base/lib/functions/bzb-functions.php on line 332

SNSでもご購読できます。