Gast
#1877820
Hallo,
ich versuch schon ne weile nen Hardwareinterrupt bei nem ATmega8
auszulösen und es will einfach nicht funktionieren.Das hier ist mein
Programmcode und ist in Pascal programmiert.
var
i,:byte;
{--------------------------------------------------------------}
{ functions }
procedure InitPorts;
begin
DDRD := %01100000;
DDRB := %00000000;
PortB:= %00000000;
GICR := %11000011;
MCUCR:= %00001100;
sreg := %10000000;
end InitPorts;
Interrupt Int0;
begin
i:=PinB.1;
sdelay(100);
if i=1 then
PortD.5:=1;
endif;
end;
Interrupt Int1;
begin
i:=PinB.1;
sdelay(100);
if i=1 then
PortD.5:=1;
endif;
end;
{--------------------------------------------------------------}
{ Main Program }
{$IDATA}
begin
InitPorts;
EnableInts;
loop
endloop;
end Interrupts.
mfg Thomas