1 / 3

演習課題の進め方

演習課題の進め方. 1.製作内容の決定 2.部品の配置を決める (回路図を描く) 3.処理の流れをフローチャートに表す 4.プログラム作成&アセンブル   (HEXファイルの生成) 5. PIC マイコンへの書込み 6.回路組立&動作検証. 課題) プログラムの動作を フローチャートで 説明する.. TRISA,TRISB による ポート入出力設定. ⇒ 資料 P.8 4) を参照. オフ (1). オン (0). A : 1111 1111 B : 1110 1111 ( 「 0 」で LED が点灯). 7. 8.

blake
Télécharger la présentation

演習課題の進め方

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 演習課題の進め方 1.製作内容の決定 2.部品の配置を決める (回路図を描く) 3.処理の流れをフローチャートに表す 4.プログラム作成&アセンブル   (HEXファイルの生成) 5.PICマイコンへの書込み 6.回路組立&動作検証

  2. 課題) プログラムの動作を フローチャートで 説明する. TRISA,TRISBによる ポート入出力設定 ⇒資料P.8 4)を参照 オフ(1) オン(0) A : 1111 1111 B : 1110 1111 (「0」でLEDが点灯) 7 8 A : 1111 1111 B : 1101 1111 6 9 5 4 A : 1111 1111 B : 1111 1110 3 2 1 A: 0111 0000 B: 1010 1110 電飾ジョッキの例

  3. コーディング例)        : CK1 BTFSC PORTA, 5 ; 0ならGOTOをスキップ GOTO CK1 ;CK1へ戻る MOVLW B’11111111’;ポートA出力 MOVWF PORTA MOVLW B’11101111’;ポートB出力 MOVWF PORTB CALL WAIT0 ;1秒待ち MOVLW B’11111111’;ポートA出力 MOVWF PORTA MOVLW B’11011111’;ポートB出力 MOVWF PORTB : ※青字はコメント「;(セミコロン)」を前に付ける この回路ではPORTA, 5に取り付けたセンサがオンの時、「0」が入力される

More Related