Forum Rule: Always post complete source code & details to reproduce any issue!
-
GPIOD_PDIR set to 255 (instead of 0) when PTD0-PTD7 declared input pins on T_3.6
Why GPIOD_PDIR becomes 255 as soon as pins PTD0-PTD7 (PORTD0-7) become input??
Should not that be 0?
for Teensy 3.2 GPIOD_PDIR becomes 0
for Teensy 3.6 GPIOD_PDIR becomes 255
Code
const byte D0 = 2;
const byte D1 = 14;
const byte D2 = 7;
const byte D3 = 8;
const byte D4 = 6;
const byte D5 = 20;
const byte D6 = 21;
const byte D7 = 5;
void setup() {
pinMode(D0, INPUT);
pinMode(D1, INPUT);
pinMode(D2, INPUT);
pinMode(D3, INPUT);
pinMode(D4, INPUT);
pinMode(D5, INPUT);
pinMode(D6, INPUT);
pinMode(D7, INPUT);
}
void loop() {
//This prints 255 for Teensy 3.6 !!!
Serial.printf("\nGPIOD_PDIR is: %d", GPIOD_PDIR ); //GPIOD_PDIR & 0xFF
delay(10000);
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules