Atmel AVR
AVR(AVR)は、Atmel社が1996年に開発した、RISCベースの8ビットマイクロコントローラ(制御用IC)製品群の総称である。201…

AVR(AVR)は、Atmel社が1996年に開発した、RISCベースの8ビットマイクロコントローラ(制御用IC)製品群の総称である。2016年以降はMicrochip社によって製造・販売されている。
概要
何かの略称ではなく「AVR」で一語である、とAtmelでは言っている。尤も、初期はアーキテクチャ開発者であるノルウェー科学技術大学の2人の学生アルフ・エギル・ボーゲン(Alf-Egil Bogen)とヴェガード・ウォラン(Vegard Wollan)の名を取り、「アルフとヴェガードによるRISC」の意味があったという。
PIC同様に回路構成が簡単でCPU、メモリ(RAM、ROM)、I/O、データ記憶用のEEPROM、クロック発振回路、タイマーなどが1チップに収められており、書き込まれたプログラムにより制御される。
ISP (In-System Programming) に対応し、コンパレータを内蔵する等、i8051ピンコンパチ品や外部にRAMやI/Oを増設する外部バスのあるものもあり、電子工作を行う人の間で人気がある。ISPには、In Circuit Serial Programming (ICSP) やJTAGという仕組みがある。
品種によっては、USBコントローラを内蔵した上でDFU対応Bootloaderをプログラムした状態で出荷されるものがあり、それらは外付け回路無しにUSB接続でプログラミング可能である。
また、ラインが変わっても基本的なCPUコアのアーキテクチャが変わらず、RAM空間がリニアである等、C言語でのプログラミングを意識しており、さらにアセンブラを含んだ統合開発環境「AVR Studio」が無償配布され、GCCも対応しているため安価に開発環境を構築できる。
MCSエレクトロニクス社より4Kバイト(2Kワード)までのコード生成が無償試用できるBascomAVRというBASICを基調としたコンパイラーが公開されている。液晶表示コマンド等、即実用可能なコマンド満載でC言語やマシン語にアレルギーのある人でも簡単にAVRを試用できる。(ただしRAM未搭載のものは殆どのコマンド使用不可)
プログラム格納用のROMは全品種でFlashROMを採用している。ハーバード・アーキテクチャである。
AVRの種類
起源となった90Sシリーズと、それを大容量化、I/Oを拡張したMegaシリーズ、高機能化・低消費電力化・低電圧対応したTinyシリーズがあり、今後は、MegaシリーズとTinyシリーズを主力する方向であるが、90Sシリーズもまだ多く使われている。
既に品種数がかなり多く、廃品種となったものも多いため、流通量が多い主な品種や著名な品種のみを取り上げ、特定顧客・特殊用途向けは割愛する。
- 90Sシリーズ
- 90S1200
- 90S2313
- 90S4433
- 90S8515
- 90S8535
- Megaシリーズ
- Mega1280/2560
- Mega8/48/88/168/328
- Mega161/162
- Mega163/323
- Mega169/329/649
- Mega8515
- Mega8535
- Mega16/32
- Mega64/128
- Tinyシリーズ
| Tinyシリーズ | I/Oピン数 | 8bitタイマ | 16bitタイマ | PWM | Flash mem | EEPROM | SRAM |
|---|---|---|---|---|---|---|---|
| tiny2313 | 18 | 1 | 1 | 4 | 2kByte | 128Byte | 128Byte |
| tiny4313 | 18 | 1 | 1 | 4 | 4kByte | 256Byte | 256Byte |
| tiny4 | 4 | 0 | 1 | 2 | 512Byte | 0Byte | 32Byte |
| tiny5 | 4 | 0 | 1 | 2 | 512Byte | 0Byte | 32Byte |
| tiny9 | 4 | 0 | 1 | 2 | 1kByte | 0Byte | 32Byte |
| tiny10 | 4 | 0 | 1 | 2 | 1kByte | 0Byte | 32Byte |
| tiny13 | 6 | 1 | 0 | 2 | 1kByte | 64Byte | 64Byte |
| tiny20 | 12 | 1 | 1 | 3 | 2kByte | 0Byte | 128Byte |
| tiny24 | 12 | 1 | 1 | 4 | 2kByte | 128Byte | 128Byte |
| tiny26 | 16 | 2 | 0 | 4 | 2kByte | 128Byte | 128Byte |
| tiny40 | 18 | 1 | 1 | 2 | 4kByte | 0Byte | 256Byte |
| tiny44 | 12 | 1 | 1 | 4 | 4kByte | 256Byte | 256Byte |
| tiny45 | 6 | 2 | 0 | 6 | 4kByte | 256Byte | 256Byte |
| tiny85 | 6 | 2 | 0 | 6 | 8kByte | 512Byte | 512Byte |
AVRのレジスタセット
| 呼称 | 説明 |
|---|---|
| R0-25 | 汎用レジスタ R0-R15は即値演算不可 |
| X(R26,R27) | インデックスレジスタX |
| Y(R28,R29) | インデックスレジスタY |
| Z(R30,R31) | インデックスレジスタZ |
| PC | プログラムカウンタ |
| SP | スタックポインタ |
| SREG | ステータスレジスタ |
命令セット
- 16ビット固定長
- C言語でのプログラミングを意識した命令群
- メモリへのアクセスはロードとストアのみであり、演算はレジスタとレジスタあるいはイミディエイトのみ
- イミディエイト減算やキャリー付加減算のサポート
- Megaシリーズは乗算命令をサポート
主なアドレッシングモード
| 呼称 | 説明 |
|---|---|
| イミディエイト | 直接8ビットの値を指定する。 |
| 直接 | 直接16ビットの番地を指定する。 |
| 間接 | X,Y,Zレジスタで番地を指定する。ディスプレースメント付、ポストインクリメント、プリデクリメントも可。 |
関連項目
- PIC - Microchip社が開発したマイクロコントローラ。元AVRの競合製品だが現在は併売されている
- Arduino - AVRを利用したオープンソースハードウェア
- 組み込みシステム
- シーケンス制御
外部リンク
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.