Hi, Jose,
I have checked the schematics,I find out that the PTD0~3 are connected to the other components on the FRDM-K22F, for example PTD0 is connected to pin 11of FXOS8700CQ, pin11 of J6(RF connector). PTD1 is connected to pin 9 of FXOS8700CQ, pin5 of J6(RF connector). PTD2 is connected to pin p3 pin of J8(SD card), PTD3 is connected to p3 pin of J8.
i think you'd better remove the serial resistor between PTDx and the active component to avoid influence.
BTW, I suppose that you enable the PORTD clock in SIM_SCGC5, abd write the PORT register correctly.
SIM_SCGC5|=0x1000;
PORTD_PCR0|=2<<8;
PORTD_PCR1|=2<<8;
PORTD_PCR2|=2<<8;
PORTD_PCR3|=2<<8;
Hope it can help you
BR
Xiangjun Rong