Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 8 of 8

Thread: Remapping pin 13

Threaded View

  1. #1
    Senior Member
    Join Date
    Jun 2013
    Location
    So. Calif
    Posts
    2,828

    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?

    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
    Does the Teensy3 AVR-compatible SPI library undo this?
    Last edited by stevech; 03-25-2014 at 11:28 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •