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