Gast
#221093
Hallo, ich möchte mal kurz Nachfragen, ob der ARM mehrere Interrupte verarbeiten kann: Ich habe folgendes Problem, dass, wenn ich nur einen Interrupt für I2C benutze läuft alles. Benutze ich alleine nur Timer0 Interrupt, dann geht auch alles, aber wenn ich beide benutze, dann kommt nur noch einer. I2C init: VICIntSelect &= ~( 1 << VIC_I2C_POS ); // I2C ist ein IRQ VICIntEnable |= ( 1 << VIC_I2C_POS ); // Interrupt freigaben. VICVectCntl1 = 0x20 | VIC_I2C_POS;// Slot 3 für I2C Interrupt festlegen. VICVectAddr1 = (unsigned)I2CISR; //Interruptroutine eintragen I2C Interrupt - Routine: I2CONCLR = 0x08; // Interrupt zurücksetzen VICVectAddr = 0; Timer0 Init: VICIntSelect &= ~( 1 << VIC_T0_POS ); // Timer 0 ist ein IRQ VICIntEnable |= ( 1 << VIC_T0_POS ); // Timer 0 Interrupt freigeben VICVectCntl0 = 0x20 | VIC_T0_POS; //Diesen auf Slot 2 legen und freigeben. VICVectAddr0 = (unsigned int)timer0ISR; // Interruptroutine eintragen. /* Reset timer 0 */ T0TCR = FALSE; // Timer 0 löschen T0PR = PCLK / 2000; // Setze den Vorteiler auf 1 ms T0MR0 = ms; // Benutze das Match 0 Register T0MCR = 3; // Lade Timer 0 neu und resete diesen T0TCR = TRUE; // Timer 0 starten. T0IR = 0xFF; // Lösche alle Interrupt anforderungen. Timer0 Interruptroutine: taskmain(); // Haupttaskroutine T0IR = 0xFF; // Timer 0 Interrupt löschen VICVectAddr = 0; static void timer0ISR(void) _attribute_ ((interrupt ("IRQ"))); void I2CISR (void) _attribute_ ((interrupt ("IRQ"))); Danke und gruss Harry