« Utiliser les PIC 16F et 18F/Interruption timer0 en langage C » : différence entre les versions
Contenu supprimé Contenu ajouté
m Robot : Remplacement de texte automatisé (-\n(==={0,3})(?: *)([^\n=]+)(?: *)\1(?: *)\n +\n\1 \2 \1\n) |
m Robot : Remplacement de texte automatisé (-(<|</)source([ \t>]) +\1syntaxhighlight\2) |
||
Ligne 44 :
|-
|<
void interrupt() {
// traitement interruption
Ligne 54 :
while(1);
}
</
| <
void interrupt it_gene(void);
Ligne 67 :
}
</
|}
Ligne 80 :
Avec le compilateur Hitech C les bits T0IE et GIE gardent leur noms.
<
//******** Hitech C **************
#include <pic1684.h>
Ligne 99 :
TOIF = 0; // c’est reparti pour un tour
}
</syntaxhighlight>
=== Exemple d'application ===
Ligne 124 :
|-
| <
void interrupt() {
// traitement interruption
Ligne 133 :
// traitement
while(1);
} </
| <
#pragma config WDT = OFF
#pragma config DEBUG=ON
Ligne 153 :
while(1);
}
</syntaxhighlight>
|}
=== Exemple complet ===
Voici un exemple complet en C18 :
<
//******** C18 *********************
#include<p18f452.h>
Ligne 194 :
}
</syntaxhighlight>
{{Bas de page
|