hier mal ein test programm ,schreibe es für deinen controller um.

' Programm zum Abfragen der Tasten
'*******************************
$regfile = "2313def.dat" 'AT90S2313
$crystal = 4000000 'Quarz: 4,0 MHz
'******** Initialisierung ********
Ddrb = &B11111111 'PortB als Ausgang
Ddrd = &B0000000 'portd als Eingänge
Portd.2 = 1 '-pull up Widerstand
Portd.3 = 1 '-pull up Widerstand
'******** Hauptprogramm ********
Do
If Pind.2 = 0 Then Portb.1 = 1
If Pind.3 = 0 Then Portb.1 = 0
Loop

End