Gast
#90555
Hallo Leute, ich hoffe ihr könnt mir weiter helfen. ich versuche im Moment vergeblich irgendwelche Interrupts bei einem Tiny26 zu erzeugen. Der nachfolgende C-Code sollte ein Interrupt INT0 beim ändern des INT0 Pins PB6 erzeugen und eine LED, die irgendwo an PORTA angeschlossen sein kann zum leuchten zu bringen. Sieht jemand von Euch, wo ich den Fehler drin habe? Danke Gruß ------------------Code--------------------------------------------- #include <avr/io.h> #include <avr/signal.h> #include <avr/interrupt.h> SIGNAL (SIG_INT0) { //LED will go an PORTA = 0x00; //waiting for sync asm volatile ("NOP"); } int main (void) { //Configure PortA as output DDRA = 0xff; //Configure PortB as Output DDRB = 0xff; //Clear PortB pin6 PORTB &= ~(1 << PINB6); //Configure POrt B Pin6 as Input DDRB &= ~(1 << DDB6); //Aktivate INT0 GIMSK = _BV(INT0); //Configure INT0 so that every level change will generate Interrupt MCUSR = _BV(ISC00); //Set all Pins of PortA LED will go off PORTA = 0xff; //Enable all Interrupts sei(); //So far do nothing util Interrupt occurs for (;;) { asm volatile ("nop"); } PORTA = 0xff; }