This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/MSP432P401R: SYSCFG Change pin function

Part Number: MSP432P401R

Tool/software: Code Composer Studio

I have a situation where I have P3.7 configured as MISO for a SPI peripheral. I wish to be able to read the state of this pin (when not performing a SPI read or write) as you would a GPIO input pin. Do I reconfigure the pin as a GPIO, read the state, then set back to SPI function? I have used SYSCFG to configure everything, how do I change the pin to a GPIO during run-time?

  • Hi Jon,

    You can look at section 12.2.6 Function Select Registers (PxSEL0, PxSEL1) of the Technical Reference Manual at https://www.ti.com/lit/pdf/slau356. You will need to reconfigure P3.7 pin for GPIO functionality and after reading the state of the pin, you will have to reconfigure it for SPI peripheral. 

    Srinivas

  • Hi Srinivas, I am aware of how to do this at the register level. I am wondering if there is a way using the TI Drivers?

    The only method I see in the GPIO driver for configuration is GPIO_setConfig(uint_least8_t index, GPIO_PinConfig pinConfig). This method requires the index of the initialized GPIO pin in the GPIO array. SYSCFG gives me a resource conflict if I try to use P3.7 as MISO and GPIO input.

    If there is not a higher level driver way I will just use the Function Select Registers to do it. Thank you for your response.

     

  • Hi Jon,

    The SYSCFG tool lets you specify a static configuration. In your application, you are trying to use the same resource for two different purposes and hence it is giving a resource conflict. You will have to use SYSCFG to specify the primary functionality for that resource (P3.7). Manually add the necessary functionality in your application for the secondary use of P3.7. I do not think there is any other automated way.

    Srinivas