Bonsoir,
J'ai un problème d'interruptions externes. Je n'arrive pas à utiliser l'entrée INT0 pour détecter un front, et là je sèche vraiment, j'ai casi tout essayé.
Voilà le programme :
#define F_CPU 1000000UL
#include <avr/io.h>
#include <avr/signal.h>
#include <avr/interrupt.h>
#define CAPTEUR PB0
#define SORTIE PB4
void init(void)
{
// config E/S
DDRB &= ~_BV(CAPTEUR);
DDRB |= _BV(SORTIE);
// config Int0
PCMSK = 0x01;
MCUCR = 0x02;
GIMSK = 0x40;
}
int main(void)
{
init();
sei();
while(1)
{
}
return 0;
}
SIGNAL(SIG_INTERRUPT0)
{
PORTB |= _BV(SORTIE);
}
C'est simple, je n'ai rien en sortie, alors que j'ai bien un front descendant sur INT0.
Merci

