Forum: Mikrocontroller und Digitale Elektronik ATMega16


von Stangl Thomas (Gast)


Lesenswert?

Hallo,

hab wiedermal eine Frage.
Hat schon mal wer die externen Inerupt von einen ATMega 16 benutzt?

Bei mir funktioniert nur der INT0 und der INT1 will einfach nicht.

Mit einen anderen Controller wie den AT90S8515 funktioniert es
einwandfrei?

Ich währe für jede Hilfe dankbar!

Gruß Thomas

von harry (Gast)


Lesenswert?

na aber logisch funzt der.
haste die auch alle 'enabled'?
in bascom geht's so:

enable interrupts
enable int0
enable int1

fertig

achso, dann natürlich noch:

on int0 aufruf0
on int1 aufruf1

aufruf0:

...code...

gruss, harry

von Stangl Thomas (Gast)


Lesenswert?

Hallo,
ich bin doch nicht blöd!

Mein Beispielprogramm:

$regfile = "M16def.dat"
$crystal = 4000000

On Int1 Int1_isr
On Int0 Int0_isr

Config Int1 = Falling
Config Int0 = Falling

Config Portd = Input                    ' PD3 ist INT1
Portd = 255

Enable Int1
Enable Int0
Enable Interrupts

Do
  nop
Loop

End

Int1_isr:
  nop
Return

Int0_isr
   nop
Return


mit z.B. einen AtMega161 funktionieren beide, aber mit den AtMega16 nur
Int0.
oder liegt das an meinen Compiller.

Gruß Thomas

von conlost (Gast)


Lesenswert?

Hallo,
haste die richtige include-Datei benutzt,
wegen der interrupt-Adressen?
Gruß,
Arno

von Stangl Thomas (Gast)


Lesenswert?

Hallo,
in Basic reicht $regfile = "M16def.dat"

zumindest bis jetz noch.


Gruß Thomas

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.