TP 1 Prise en main
TP 1 Prise en main TP 1 Prise en main
TP -II2 Programmation C sur PIC avec EasyPIC5 et MikroC (IUT Troyes)S. Moutou et F. Morain-Nicolier6 unsigned char cmpt;7 ANSEL = ANSELH =0;8 INTCON = 0; // Disable GIE, PEIE,INTE,RBIE,T0IE9 PORTA = 0;10 TRISA = 0;11 PORTD = 0;12 TRISD = 0;13 cmpt=0;14 do {15 cmpt++;16 if (cmpt > 99) cmpt = 0;17 for (i = 0; i 9) cmpt +=6; // grosse astuce ici17 if (cmpt > 99) cmpt = 0;18 for (i = 0; i >4); // bring appropriate value to PORTD25 PORTA = 2; // turn on appropriate 7seg. display26 Delay_ms(10);27 }28 } while (1); //endless loop29 }3. Exercice 4.41 // exo4 TP42 // Affichage sur quatre digits20/22 Réalisé avec OpenOffice sous Linux
TP -II2 Programmation C sur PIC avec EasyPIC5 et MikroC (IUT Troyes)S. Moutou et F. Morain-Nicolier3 unsigned short mask(unsigned short num) ;4 void main() {5 unsigned short i;6 unsigned char cmpt;7 ANSEL = ANSELH =0;8 INTCON = 0; // Disable GIE, PEIE,INTE,RBIE,T0IE9 PORTA = 0;10 TRISA = 0;11 PORTD = 0;12 TRISD = 0;13 cmpt=0;14 do {15 cmpt++;16 if (cmpt > 1023) cmpt = 0;17 for (i = 0; i
- Page 1 and 2: TP -II2 Programmation C sur PIC ave
- Page 3 and 4: TP -II2 Programmation C sur PIC ave
- Page 5 and 6: TP -II2 Programmation C sur PIC ave
- Page 7 and 8: TP -II2 Programmation C sur PIC ave
- Page 9 and 10: TP -II2 Programmation C sur PIC ave
- Page 11 and 12: TP -II2 Programmation C sur PIC ave
- Page 13 and 14: TP -II2 Programmation C sur PIC ave
- Page 15 and 16: TP -II2 Programmation C sur PIC ave
- Page 17 and 18: TP -II2 Programmation C sur PIC ave
- Page 19: TP -II2 Programmation C sur PIC ave
<strong>TP</strong> -II2 Programmation C sur PIC avec EasyPIC5 et MikroC (IUT Troyes)S. Moutou et F. Morain-Nicolier6 unsigned char cmpt;7 ANSEL = ANSELH =0;8 INTCON = 0; // Disable GIE, PEIE,INTE,RBIE,T0IE9 PORTA = 0;10 TRISA = 0;11 PORTD = 0;12 TRISD = 0;13 cmpt=0;14 do {15 cmpt++;16 if (cmpt > 99) cmpt = 0;17 for (i = 0; i 9) cmpt +=6; // grosse astuce ici17 if (cmpt > 99) cmpt = 0;18 for (i = 0; i >4); // bring appropriate value to PORTD25 PORTA = 2; // turn on appropriate 7seg. display26 Delay_ms(10);27 }28 } while (1); //<strong>en</strong>dless loop29 }3. Exercice 4.41 // exo4 <strong>TP</strong>42 // Affichage sur quatre digits20/22 Réalisé avec Op<strong>en</strong>Office sous Linux