Gast
#100862
Ich will ja nicht jammer, aber der Interrupt will einfach nicht
funktionieren. Hier mal mal Sourceode zum gucken:
#define CPU_CLOCK 8000000 // Frequenz in Hertz, ggf ändern
#define UART_BAUD_RATE 9600 // Wir versuchen mal mit 9600 Baud
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/signal.h>
#include "lcd.c"
#define RPM_PORT PORTA
#define RPM_PIN 7
#define RPM_PINS PINA
int main(void)
{
lcd_init(LCD_DISP_ON);
lcd_clrscr();
lcd_puts("Starte \n200sx Timer...");
DDR(RPM_PORT) |= _BV(RPM_PIN); // RPM_PIN als Eingang schalten
//enable_external_int ((1<<INT0));
//sei (); // Interrupts aktivieren
DDRA |=0;
GIMSK = 1<<INT1; // Interrupt von INT0 enablen
MCUCR = 1<<ISC10 | 1<<ISC11; // Interrupt on rising edge
for (;;) {
if( RPM_PINS & (1<<RPM_PIN) ) {
lcd_puts("Taste");
}
}
}
SIGNAL (SIG_INTERRUPT0)
{
lcd_puts("TasteX");
outp (0xFF, DDRB);
outp (0xCF, PINB);
}
Ich wäre um hilfe sehr dankbar