Remapping SCK/pin 13 [SOLVED]
From the RF22 library, this code attempts to remap SCK from pin 13 to pin 14 so that the onboard LED on pin 13 can be used without affecting SCK.
What I see via my scope is that SCK appears on both pins. I'm not studied on the K20 pin mapping, so is there a kind soul that has a correction?
Does the Teensy3 AVR-compatible SPI library undo this?
From the RF22 library, this code attempts to remap SCK from pin 13 to pin 14 so that the onboard LED on pin 13 can be used without affecting SCK.
What I see via my scope is that SCK appears on both pins. I'm not studied on the K20 pin mapping, so is there a kind soul that has a correction?
Code:
// Add by xxx (name redacted)
#if defined (__MK20DX128__) || defined (__MK20DX256__)
// First reassign pin 13 to Alt1 so that it is not SCK but the LED still works
CORE_PIN13_CONFIG = PORT_PCR_MUX(1);
// and then reassign pin 14 to SCK
CORE_PIN14_CONFIG = PORT_PCR_DSE | PORT_PCR_MUX(2);
#endif
Last edited: