ATMega16

Gast #65638
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
Gast #65639
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
Gast #65640
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

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren