HI Sandeep,
I'm not sure about FRDM-K28F configuration setup, but every port in the MCU can be made as Input or Output or both. But you will have to configure that manually without help of processor expert. The details of making the will be available in the reference manual of ur microcontroller in Port Control And Interrupts chapter. I've made sample code for mk10dn64vlh5 configuring some pins as i/p and some as o/p of same port. Below is the snippet.:
void InitPorts(void)
{// enable port clock
SIM_SCGC5 |= 1u << SIM_SCGC5_PORTA_SHIFT;
SIM_SCGC5 |= 1u << SIM_SCGC5_PORTB_SHIFT;
SIM_SCGC5 |= 1u << SIM_SCGC5_PORTC_SHIFT;
SIM_SCGC5 |= 1u << SIM_SCGC5_PORTD_SHIFT;
SIM_SCGC5 |= 1u << SIM_SCGC5_PORTE_SHIFT;
PORTC_PCR0 = 0x00000140; //Output Pin
PORTC_PCR1 = 0x00000140; //Output Pin
PORTC_PCR2 = 0x00000140; //Output Pin
PORTC_PCR3 = 0x00000140; //Output Pin
PORTC_PCR4 = 0x00000140; //Output Pin
PORTC_PCR5 = 0x00000143; //Input Pin
PORTC_PCR6 = 0x00000143;//Input Pin
PORTC_PCR7 = 0x00000143;//Input Pin
PORTC_PCR8 = 0x00000143;//Input Pin
PORTC_PCR9 = 0x00000143;//Input Pin
PORTC_PCR10 = 0x00000143;//Input Pin
PORTC_PCR11 = 0x00000143;//Input Pin
GPIOC_PDDR = 0x0000001F; //Setting Direction of Pin(0 for input and 1 for output)
GPIOC_PDOR = 0x00000000; //default output value on pins
}
Somthing similar has to be done in order to achieve your goal. Just refer to the above mentioned capter of the micronctroller and you'll be good to go.
I hope this helped.
Regards,
Prafful :smileyhappy: