I'm building a project based around the Teensy 3.6 and I'd like to be able to access 16 bits of PTD[0..15]. I realize PTD10 isn't available on the Teensy, but all the others are. Here's my test code, it's very simple:
I expect that this will set all of PORTD to input, and then once per second produce the binary output of the pin state. I have wires soldered to Teensy pins 47, 48, 51, 52, 53, 54, and 55, so I can (or so I thought) read individual bits of PORTD, which I change by moving jumper wires to 3V3 or GND.
However, I can still only read the values of PTD[0..7]. 8, 9, and 11-15 do nothing. Is there a way to read all 16 bits with one GPIOD_PDIR read? I'm digging through the datasheet now and trying various things, and I'll update this thread if I answer it myself, but for now, I'd really appreciate some help on this.
Code:
void setup() {
DDRD = 0;
Serial.begin(9600);
}
void loop() {
int16_t x = GPIOD_PDIR;
Serial.println(x, BIN);
delay(1000);
}
I expect that this will set all of PORTD to input, and then once per second produce the binary output of the pin state. I have wires soldered to Teensy pins 47, 48, 51, 52, 53, 54, and 55, so I can (or so I thought) read individual bits of PORTD, which I change by moving jumper wires to 3V3 or GND.
However, I can still only read the values of PTD[0..7]. 8, 9, and 11-15 do nothing. Is there a way to read all 16 bits with one GPIOD_PDIR read? I'm digging through the datasheet now and trying various things, and I'll update this thread if I answer it myself, but for now, I'd really appreciate some help on this.