Gast
#238031
Hallo,
wenn ich hardware-seitig einen Interrupt auslöse springe (->) ich in
folgende interrupt-routinen:
int0 -> int1
int1 -> pcint1
pcint0 -> wdt
pcint1 -> timer2 compB
pcint2 -> timer1 capt
sieht so aus als wäre die interrupt-vektor-tabelle verbogen. weiss
allerdings nicht warum. hier meine fusebits:
bootrst x (x=checked also unprogrammed)
bootszo 0 (0=unchecked also programmed)
bootsz1 0
hab schon alles ausprobiert aber vielleicht hat noch jemand eine idee.
hier das programm:
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/signal.h>
#define FOSC 16000000 // Clock Speed
#define BAUD 9600
#define MYUBRR FOSC/16/BAUD-1
SIGNAL(SIG_INTERRUPT0){ sendt("1"); }
SIGNAL(SIG_INTERRUPT1){ sendt("2"); }
SIGNAL(SIG_PIN_CHANGE0){ sendt("3"); }
SIGNAL(SIG_PIN_CHANGE1){ sendt("4"); }
SIGNAL(SIG_PIN_CHANGE2){ sendt("5"); }
SIGNAL(SIG_WATCHDOG_TIMEOUT){ sendt("6"); }
SIGNAL(SIG_OUTPUT_COMPARE2A){ sendt("7"); }
SIGNAL(SIG_OUTPUT_COMPARE2B){ sendt("8"); }
SIGNAL(SIG_OVERFLOW2){ sendt("9"); }
//usw...
void sendc(unsigned char c) {
while (!(UCSR0A & (1<<UDRE0)));
UDR0 = c;
}
int main (void)
{
UBRR0H = (unsigned char)(MYUBRR>>8);
UBRR0L = (unsigned char)MYUBRR;
UCSR0B = (1<<RXEN0)|(1<<TXEN0)|(1<<RXCIE0);
UCSR0C =(3<<UCSZ00);
sei();
while(1);
}
die usart funktioniert allerdings nicht die rx complete routine.
dort hängt er sich dann ganz auf.
vielen dank im vorraus
grüsse, andreas.