Page 25 - SERIE N11 micro 2
P. 25

?   ?   ?   ?
       Exercice N°28 :
                                                                                           kp            PortA
      16   OSC1/CLKIN   RA0   17                                            Touche

      15                     18                                                  0             …..           …..
          OSC2/CLKOUT   RA1   1
                        RA2                                                      1             …..           …..
         4   MCLR       RA3   2
                 RA4/T0CKI   3                                                   2             …..           …..
                             6              A   7     8  9                       3             …..           …..
                     RB0/INT   7                                                 4             …..           …..
                        RB1   8                                                  5             …..           …..
                        RB2
                        RB3   9             B   4     5      6                   6             …..           …..
                             10
                        RB4   11                                                 7             …..           …..
                        RB5   12                                                 8             …..           …..
                        RB6
                        RB7   13            C   1  2  3                          9             …..           …..
          PIC16F84A
                                                                                  /            …..           …..
                                            D  ON     0                           *            …..           …..
                                                 C           =     +  +           -            …..           …..
                                                                                 +             …..           …..
                                              1      2      3      4           On/c            …..           …..
                                                                                 =             …..           …..

                                      ?   ?   ?   ?


      16                       17

      15   OSC1/CLKIN    RA0   18
                         RA1
           OSC2/CLKOUT
                         RA2   1
                         RA3
         4   MCLR    RA4/T0CKI   2            7             8             9             /
                               3
                               6
                       RB0/INT   7
                         RB1
                         RB2   8              4             5             6             *           10k
                               9
                         RB3   10
                         RB4
                         RB5   11                                                                   10k
                               12
                         RB6
                         RB7   13             1             2             3             -
          PIC16F84A
                    10k                                                                             10k
                    10k                       ON/C          0             =             +

                    10k                                                                             10k
                    10k
       Lire le programme ci-dessous puis remplir le tableaux
       program exercice_N_28_Clavier;
       var keypadPort : byte at PORTB;              //le clavier est relie au port B
       var kp : byte;                                            // On déclare une variable kp de type octet
       begin
       trisa:=0;                                                     // Le portA est configure en sortie
       porta:=0;                                                 // Initialisation du portA
       Keypad_lnit();                                      // initialiser le portB pour communiquer avec le clavier
       while true do
       begin
       kp := Keypad_Key_Click();
       if kp <> 0 then porta:=kp;
        end ;end





                                                                                                                25
   20   21   22   23   24   25