Serial.attachCts() can this Pin be re-mapped?

Status
Not open for further replies.

zachtos

Well-known member
For attachCts I see that in Teensy 3.X these are restricted pins. They directly interfere with the audio library that I am using. Can these be moved in software easily?
 
Code:
int serial_set_cts(uint8_t pin)
{
#if defined(KINETISK)
    if (!(SIM_SCGC4 & SIM_SCGC4_UART0)) return 0;
    if (pin == 18) {
        CORE_PIN18_CONFIG = PORT_PCR_MUX(3) | PORT_PCR_PE; // weak pulldown
    } else if (pin == 20) {
        CORE_PIN20_CONFIG = PORT_PCR_MUX(3) | PORT_PCR_PE; // weak pulldown
    } else {
        UART0_MODEM &= ~UART_MODEM_TXCTSE;
        return 0;
    }
    UART0_MODEM |= UART_MODEM_TXCTSE;
    return 1;
#else
    return 0;
#endif
}
...looks like pin 18 & 20 are OK (for Serial1)
 
schematic_audio2.gif

Serial1.attachCts(pin)
Supported only on Teensy 3.0, 3.1, 3.2.
Serial1 supports pins pins 18 & 20.
Serial2 supports pin 23.
Serial3 supports pin 14.

So far I only see Serial1 having pin 18 available, all others are used unless able to re-map.
 
Or it looks like in K20 signal multiplexing sheet, that I am restricted to those pins for RTS/CTS, but the audio library maybe able to remap some of the pins like maybe SCK and LRCLK ? If so should be able to make compatible at least one pin per serial port.
 
Or it looks like in K20 signal multiplexing sheet, that I am restricted to those pins for RTS/CTS...
RTS is any pin, CTS is only restricted to certain pins. I'm using it this with a xbee for a little project i'm working on now.
 
Looks like Serial1 CTS on pin 20 is probably the most viable option if using I2S for audio and SPI for SD card access. Or pin 18, if you remap SDA to pin 17.

If using the SD card but only audio output, maybe SCK could be remapped to pin 13 if you disconnect the SGTL5000 from pin 13 and connect the SD card there instead of 14. Then you could use pin 14.

Or LRCLK could be remapped with some hacking and connecting the wire to those pins, to free up pin 23.
 
Status
Not open for further replies.
Back
Top