« 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 :
 
|-
|<sourcesyntaxhighlight lang="c"> // interruption haute priorite seulement
void interrupt() {
// traitement interruption
Ligne 54 :
while(1);
}
</sourcesyntaxhighlight>
| <sourcesyntaxhighlight lang="c"> #include <pic1684.h>
 
void interrupt it_gene(void);
Ligne 67 :
 
}
</sourcesyntaxhighlight>
|}
 
Ligne 80 :
Avec le compilateur Hitech C les bits T0IE et GIE gardent leur noms.
 
<sourcesyntaxhighlight lang="c">
//******** Hitech C **************
#include <pic1684.h>
Ligne 99 :
TOIF = 0; // c’est reparti pour un tour
}
</syntaxhighlight>
</source>
=== Exemple d'application ===
 
Ligne 124 :
 
|-
| <sourcesyntaxhighlight lang="c"> // interruption haute priorite seulement
void interrupt() {
// traitement interruption
Ligne 133 :
// traitement
while(1);
} </sourcesyntaxhighlight>
| <sourcesyntaxhighlight lang="c">#include<p18f452.h>
#pragma config WDT = OFF
#pragma config DEBUG=ON
Ligne 153 :
while(1);
}
</syntaxhighlight>
</source>
|}
=== Exemple complet ===
Voici un exemple complet en C18 :
<sourcesyntaxhighlight lang="c">
//******** C18 *********************
#include<p18f452.h>
Ligne 194 :
}
 
</syntaxhighlight>
</source>
 
{{Bas de page