検索まずは、検索! Index人気の20件
最新の20件2018-12-022018-01-092017-05-072017-04-252016-05-012015-02-242014-01-032013-06-252012-12-302012-12-292012-07-272012-07-162012-02-052012-01-292011-10-012011-09-18 |
8259 (PIC)目次
基礎知識PICとはProgrammable Interrupt Controllerの略で、割り込みを制御するコントローラです。 割り込み番号と種類
|IRQ7||LPT1
|IRQ13|FPU I/Oポート、レジスタPICのI/Oポートマップ
IRR : Interrupt Request Register (Port:0x0020,0x00a0)ISR : In-Service Register (Port:0x0020,0x00a0)IMR : Interrupt Mask Register (Port:0x0021,0x00a1)OCW1 : Operation Command Word 1 (Port:0x0021,0x00a1)OCW2 : Operation Command Word 2 (Port:0x0020,0x00a0)OCW3 : Operation Command Word 3 (Port:0x0020,0x00a0)ICW1 : Initialization Command Word 1 (Port:0x0020,0x00a0)ICW2 : Initialization Command Word 2 (Port:0x0021,0x00a1)ICW3 : Initialization Command Word 3 (Port:0x0021,0x00a1)ICW4 : Initialization Command Word 4 (Port:0x0021,0x00a1)参考ソース//PIC0 #define PORT_PIC0_IRR ( 0x0020 ) //割り込みリクエスト #define PORT_PIC0_ISR ( 0x0020 ) //イン・サービス(現在処理中の割り込み) #define PORT_PIC0_OCW2 ( 0x0020 ) //動作コマンド2 #define PORT_PIC0_OCW3 ( 0x0020 ) //動作コマンド3 #define PORT_PIC0_ICW1 ( 0x0020 ) //初期化コマンド1 #define PORT_PIC0_IMR ( 0x0021 ) //割り込みマスク #define PORT_PIC0_OCW1 ( 0x0021 ) //動作コマンド1 #define PORT_PIC0_ICW2 ( 0x0021 ) //初期化コマンド2 #define PORT_PIC0_ICW3 ( 0x0021 ) //初期化コマンド3 #define PORT_PIC0_ICW4 ( 0x0021 ) //初期化コマンド4 //PIC1 #define PORT_PIC1_IRR ( 0x00a0 ) //割り込みリクエスト #define PORT_PIC1_ISR ( 0x00a0 ) //イン・サービス(現在処理中の割り込み) #define PORT_PIC1_OCW2 ( 0x00a0 ) //動作コマンド2 #define PORT_PIC1_OCW3 ( 0x00a0 ) //動作コマンド3 #define PORT_PIC1_ICW1 ( 0x00a0 ) //初期化コマンド1 #define PORT_PIC1_IMR ( 0x00a1 ) //割り込みマスク #define PORT_PIC1_OCW1 ( 0x00a1 ) //動作コマンド1 #define PORT_PIC1_ICW2 ( 0x00a1 ) //初期化コマンド2 #define PORT_PIC1_ICW3 ( 0x00a1 ) //初期化コマンド3 #define PORT_PIC1_ICW4 ( 0x00a1 ) //初期化コマンド4 /******************************************************************************* PIC初期化 *******************************************************************************/ //すべてのPIC割り込みをマスク(禁止)する。 Out1( PORT_PIC0_IMR, 0xff ); //PIC0 Out1( PORT_PIC1_IMR, 0xff ); //PIC1 //PIC0 Out1( PORT_PIC0_ICW1, 0x11 ); Out1( PORT_PIC0_ICW2, 0x20 ); //割り込み番号IRQ0〜IRQ7を0x20〜(0x27)に指定。 Out1( PORT_PIC0_ICW3, 0x04 ); //スレーブがつながっているビットを1。(IRQ2:0b0000 0100) Out1( PORT_PIC0_ICW4, 0x01 ); //PIC1 Out1( PORT_PIC1_ICW1, 0x11 ); Out1( PORT_PIC1_ICW2, 0x28 ); //割り込み番号IRQ8〜IRQ15を0x28〜(0x2f)に指定。 Out1( PORT_PIC1_ICW3, 0x02 ); //つながっているマスタの番号 Out1( PORT_PIC1_ICW4, 0x01 ); //IRQ2(PIC1)以外のすべての割り込みをマスク Out1( PORT_PIC0_IMR, 0xfb ); //PIC0 Out1( PORT_PIC1_IMR, 0xff ); //PIC1 参考・関連 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||