SPI Slave Select as GPIO

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SPI Slave Select as GPIO

643 Views
isaacp
Contributor I

MKE02Z16VFM4 runs SPI0 as a master on PTB2, PTB3 and PTB4 (SPI0PS = 0).

PTB5 is not used as part of the SPI0 functionality (MODFEN = 0 and  SSOE = 0) and configured as a GPIO output.

However, the pin always stuck on '1' and does not change its state like any other GPIO pin.

Can anyone comment whether PTB5 is actually operating as a general purpose output while PTB2,3,4 are operating as SPI0 master?

Labels (1)
0 Kudos
1 Reply

500 Views
mjbcswitzerland
Specialist V

Hi Isaac

I believe that the pin in question is only used by the SPI when SSOE is set to '1'.
However I suggest you do the following test to confirm that it is really not being used by doing the following:

1. Attempt to drive PTB5 to '0' (stop the debugger and use the register view to ensure it is correctly set as output driving '0').
2. Now change SIM_PINSEL0 bit SPI0PS from '0' to '1' so that the complete SPI pin set switches to PTE0,1,2,3
3. If the pin stays at '1' try toggling it in the GPIO output register

Base on this I would conclude:
A. If the GPIO function starts operating when moved to PTE3 the assumption that SSOE controls the pin muxing is incorrect (also mine)
B. If the muxing between port B and port E doesn't change the behavior
B1. And if you can't control the port state as GPIO output it must be a problem with the GPIO port setup
B2. But if you can control the state in the GPIO output register it must be a completely different issue

Good luck

Regards

Mark

Complete Kinetis solutions, training and support: http://www.utasker.com/kinetis.html
Kinetis KE:
- http://www.utasker.com/kinetis/FRDM-KE02Z.html
- http://www.utasker.com/kinetis/FRDM-KE02Z40M.html
- http://www.utasker.com/kinetis/FRDM-KE04Z.html
- http://www.utasker.com/kinetis/FRDM-KE06Z.html
- http://www.utasker.com/kinetis/FRDM-KE15Z.html

0 Kudos