S32K Pin Configuration and Pin Function

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

S32K Pin Configuration and Pin Function

2,176 次查看
devang_vachhani
Contributor I

This is regarding S32K Pin Configuration and I am using S32K146.

When we select Pin Function as a GPIO Pin we also selct Pin Direction.

So would like to ask for

1. All kind of Pin function we need to config Pin input or Output direction? e.g. In case of SPI 'MOSI' Pin Function sets by defalut as 'Out'? Or we need to set it.

2. SPI CLK needs to be configure as 'Output'?

3.In case of SPI can we use any GPIO as a slave select Pin or we need to use Pin function 'LPSPI1_PCS3' to select slave

4. Can someone put some light on Pin function as FTM? and when can we use FTM Pin Function? Can we use this to supply voltage to any other peripherals Or to read supply voltage of other peripheral Or to get supply voltage form other Peripheral?

Thanks for your support in advance. 

标签 (1)
0 项奖励
回复
1 回复

1,974 次查看
victorjimenez
NXP TechSupport
NXP TechSupport

Hello, Devang Vachhnai

1. All kind of Pin function we need to config Pin input or Output direction? e.g. In case of SPI 'MOSI' Pin Function sets by defalut as 'Out'? Or we need to set it.

No, you don't need to select the direction of the pin, you just need to select the correct function of each pin. For example, if you want to use pin PTB4 as MISO of LPSPI0, then you need to select the function 3 of the pin. 

2. SPI CLK needs to be configure as 'Output'?

For this question it applies the same as question 1, you just need to select the correct function for the pin. 

3. In case of SPI can we use any GPIO as a slave select Pin or we need to use Pin function 'LPSPI1_PCS3' to select slave

You could use a normal GPIO as a slave select as well. 

I highly recommend you checking the SPI examples that we provide within the SDK for the S32K146, this way you can see how the pin configuration, among other things. The SPI drivers that we provide within the SDK uses a pin with the chip select function, if you want to use a gpio instead, you will need to make this implementation by your own. 

4. Can someone put some light on Pin function as FTM? and when can we use FTM Pin Function? Can we use this to supply voltage to any other peripherals Or to read supply voltage of other peripheral Or to get supply voltage form other Peripheral?

I would also recommend you to check the examples of FTM that we provide within the SDK. You cannot use any FTM pin to supply voltage to other peripherals neither to get supply voltage from other peripheral. The FTM can detect low and high levels of voltage (among many other things), but not measure a specific voltage. Please refer to chapter 45 of the reference manual to learn more about this module. 


Have a great day,
Victor

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
回复