PIC18F4680 PortD lower nibble als Eingang funktioniert nicht.

Gast #1941132
Lesenswert?

Hallo Zusammen,

ich nutze das EasyPic5 Entwicklerboard und teste gerade die Taster. 
Leider funktioniert PortD.0 bis PortD.3 nicht als Eingang.
Folgenden Code verwende ich für den Test:
1
void main() 
2
{
3
  ADCON0 = 0x00; // Diasable the ADC module.
4
  ADCON1 = 0x0F; // Set ADC port to digital output I/O.
5

6
  TRISB = 0x00; // Set direction of RB port to output (all Pins can be used as output).
7
  PORTB = 0x00; // Switch all pins off.
8

9
  TRISD = 0xFF; // Set portdirection to input (RD0 to RD3 not work, why?).
10

11
  do
12
  {
13
    LATB = PORTD;
14
    Delay_ms(100);
15
  } while(1);
16
}

Mit allen anderen Ports funktioniert es nur für die unteren 4 Bits von 
PortD nicht.
Was mache ich wohl falsch?

Vielen Dank,
Tim

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