Académique Documents
Professionnel Documents
Culture Documents
N° : ………
10 ………………. 20 ……………… 30
…………………
Présence d’une
………………. pièce haute
31
33
32 ……………
…………… ……………
….
…… …… ……………
12 22
33
=1
0 A0 = …………………… D0 = …………….
1 A1 = …………………… D1 = …………….
X0 = ……………………………………………………………………………
X10 = ……………………………………………………………………………
X11 = ……………………………………………………………………………
X20 = ……………………………………………………………………………
X22 = ……………………………………………………………………………
X30 = ……………………………………………………………………………
X31 = ……………………………………………………………………………
TRISC … … … … … … … … =0x……
PROGRAMME Commentaires
sbit L11 at RA0_bit; sbit L20 at …………..._bit;
sbit …….………..at RA2_bit; sbit Dcy at ……………_bit;
sbit P1 at ……………_bit; sbit …………….. at RB2_bit;
sbit P3 at ………………._bit; sbit ………………at RB4_bit;
sbit S1 at RB5_bit; sbit S2 at RB6_bit; //Déclaration des
sbit L10 at RB7_bit; sbit KM1 at RC0_bit; sbit KM4 at RC1_bit; variables
sbit …….………..at RC2_bit; sbit ……. at ……………_bit;
sbit M14_1 at ……………_bit; sbit …………….. at RC5_bit;
sbit M14_2 at ………………._bit; sbit ………………at RC7_bit;
……..X0,X1,X10,……,…….,X20 ,…..,…….X30,…….,X32,….;
void main() { //Mot clé et Début
TRISA=0x…………………...;
TRISB=0x…………………..; TRISC=0x…………………..;
PORTC=……………………; Adcon1=0x……………. //Configuration et
X0=…….; X1=0 ; X10=……..;X11=0; X12=……….; X20=0; Initialisation
}
}
Port A Port B
RA0 Non utilisée RB0
RA1 RB1
RA2 RB2
RA3 RB3
RA4 RB4
RA5 RB5
RA6 RB6
RA7 RB7
3- A partir du registre de configuration Option_Reg (dossier technique ), compléter les tableaux
suivants pour configurer le TMR0 en mode compteur :
{ // Début programme
} // Fin programme.