Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > de.sci.electronics > #309447

Re: MPLAB Simulator für AVR kaputt?

From Josef Moellers <josef.moellers@invalid.invalid>
Newsgroups de.sci.electronics
Subject Re: MPLAB Simulator für AVR kaputt?
Date 2021-09-01 10:46 +0200
Message-ID <ip8svoFeilpU1@mid.individual.net> (permalink)
References <io46cfFb4q2U1@mid.individual.net> <ip7gqjF6cmhU1@mid.individual.net>

Show all headers | View raw


On 31.08.21 22:13, Gunther Mannigel wrote:
> Am 18.08.2021 um 12:40 schrieb Peter Heitzer:
>> Ich versuche gerade mit der neuesten MPLAB X IDE ein einfaches
>> Programm für einen ATTiny13a im Simulator zu testen.
>>
>> #include <xc.h>
>> #include <avr/io.h>
>>
>> uint8_t ov=0;
>> void __interrupt(TIM0_OVF_vect_num) t0isr(void) {
>>      ov++;
>> }
> 
> Tiny kenne ich jetzt nicht, aber das kann daran liegen, dass das
> Interruptflag per Software zurückgesetzt werden muss. Der springt
> aus der ISR gleich wieder rein.

Beg to differ!

Das Handbuch sagt allgemein (S.13):

There are basically two types of interrupts. The first type is triggered
by an event that sets the Interrupt Flag. For these interrupts, the
Program Counter is vectored to the actual Interrupt Vector in order to
execute the interrupt handling routine, and hardware clears the
corresponding Interrupt Flag. Interrupt Flags can also be cleared by
writing a logic one to the flag bit position(s) to be cleared.

The second type of interrupts will trigger as long as the interrupt
condition is present. These interrupts do not necessarily have Interrupt
Flags.

Konkret steht dann zum TOV0 (S.76):

The bit TOV0 is set when an overflow occurs in Timer/Counter0. TOV0 is
cleared by hardware when executing the corresponding interrupt handling
vector.

Bei den PICs ist das so, wie Du das beschreibst (BTDTNT).

Ich stolpere aber über die Definition der ISR. Meine (OK, für einem
ATmega168) sieht so aus:
ISR(TIMER0_COMPA_vect)
{
}
und ... nein, ich lösche kein Interrupt Flag in der ISR.

Josef

Back to de.sci.electronics | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

MPLAB Simulator für AVR kaputt? "Peter Heitzer" <peter.heitzer@rz.uni-regensburg.de> - 2021-08-18 10:40 +0000
  Re: MPLAB Simulator für AVR kaputt? Gunther Mannigel <newsgroups@mannigel.net> - 2021-08-31 22:13 +0200
    Re: MPLAB Simulator für AVR kaputt? Josef Moellers <josef.moellers@invalid.invalid> - 2021-09-01 10:46 +0200
      Re: MPLAB Simulator für AVR kaputt? Hans-Peter Diettrich <DrDiettrich1@aol.com> - 2021-09-01 11:35 +0200
        Re: MPLAB Simulator für AVR kaputt? Josef Moellers <josef.moellers@invalid.invalid> - 2021-09-01 13:57 +0200
          Re: MPLAB Simulator für AVR kaputt? Michael Bäuerle <michael.baeuerle@stz-e.de> - 2021-09-01 14:28 +0200
            Re: MPLAB Simulator für AVR kaputt? Josef Moellers <josef.moellers@invalid.invalid> - 2021-09-01 14:46 +0200
          Re: MPLAB Simulator für AVR kaputt? Hans-Peter Diettrich <DrDiettrich1@aol.com> - 2021-09-01 18:41 +0200
            Re: MPLAB Simulator für AVR kaputt? Michael Bäuerle <michael.baeuerle@stz-e.de> - 2021-09-01 19:29 +0200
              Re: MPLAB Simulator für AVR kaputt? Hans-Peter Diettrich <DrDiettrich1@aol.com> - 2021-09-02 01:36 +0200
            Re: MPLAB Simulator für AVR kaputt? Michael Schwingen <news-1513678000@discworld.dascon.de> - 2021-09-01 19:11 +0000
              Re: MPLAB Simulator für AVR kaputt? Hans-Peter Diettrich <DrDiettrich1@aol.com> - 2021-09-02 01:51 +0200
                Re: MPLAB Simulator für AVR kaputt? Michael Schwingen <news-1513678000@discworld.dascon.de> - 2021-09-03 20:09 +0000
                Re: MPLAB Simulator für AVR kaputt? Hans-Peter Diettrich <DrDiettrich1@aol.com> - 2021-09-04 07:09 +0200
      Re: MPLAB Simulator für AVR kaputt? Gunther Mannigel <newsgroups@mannigel.net> - 2021-09-01 21:28 +0200

csiph-web