Where are T4 & Micromod pin functions setup / allocated?

ninja2

Well-known member
On a standard T4.1 pins 16/17 = A2/A3 = Rx4/Tx4 = Serial4

For the Micromod teensy I think the same pins 16/17 might be Serial2 but I need to be absolutely sure, so I went looking for clues in
...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\cores\teensy4
but quickly got lost in details.

Where are the Serial ports allocated?
And is the Micromod processor different to T4.1 w.r.t allocation for pins 16/17 ??

TIA
 
For PJRC products, like T4.1... and T4 you can look at the web page:

You can look at my Spreadsheet....

In the source code, for Serial2:
teensy4\hardwareSerial2.cpp:
Code:
#ifndef ARDUINO_TEENSY_MICROMOD
static HardwareSerialIMXRT::hardware_t UART4_Hardware = {
    1, IRQ_LPUART4, &IRQHandler_Serial2,
    &serialEvent2,
    CCM_CCGR1, CCM_CCGR1_LPUART4(CCM_CCGR_ON),
    {{7,2, &IOMUXC_LPUART4_RX_SELECT_INPUT, 2}, {0xff, 0xff, nullptr, 0}},
    {{8,2, &IOMUXC_LPUART4_TX_SELECT_INPUT, 2}, {0xff, 0xff, nullptr, 0}},
    0xff, // No CTS pin
    0, // No CTS
    IRQ_PRIORITY, 38, 24, // IRQ, rts_low_watermark, rts_high_watermark
    XBARA1_OUT_LPUART4_TRG_INPUT
};
HardwareSerialIMXRT Serial2(IMXRT_LPUART4_ADDRESS, &UART4_Hardware, tx_buffer2,
    SERIAL2_TX_BUFFER_SIZE, rx_buffer2, SERIAL2_RX_BUFFER_SIZE);

#else  // Teensy Micromod
static HardwareSerialIMXRT::hardware_t UART3_Hardware = {
    3, IRQ_LPUART3, &IRQHandler_Serial2,
    &serialEvent2,
    CCM_CCGR0, CCM_CCGR0_LPUART3(CCM_CCGR_ON),
    {{16,2, &IOMUXC_LPUART3_RX_SELECT_INPUT, 0}, {0xff, 0xff, nullptr, 0}},
    {{17,2, &IOMUXC_LPUART3_TX_SELECT_INPUT, 0}, {0xff, 0xff, nullptr, 0}},
    0xff, // No CTS pin
    0, // No CTS
    IRQ_PRIORITY, 38, 24, // IRQ, rts_low_watermark, rts_high_watermark
    XBARA1_OUT_LPUART3_TRG_INPUT
};
HardwareSerialIMXRT Serial2(IMXRT_LPUART3_ADDRESS, &UART3_Hardware, tx_buffer2,
     SERIAL2_TX_BUFFER_SIZE, rx_buffer2, SERIAL2_RX_BUFFER_SIZE);
#endif
It was decided during the MicroMode Alpha/Beta release that Serial2 and Serial4 were sort of swapped on which
LPUART and pins...

So you can see that on T4 and T4.1, Serial2 uses LPUART4
Pin 7 is RX and Pin 8 is TX
RX is 16 and TX is 17
Where on MMOD: LPUART3
 
Thanks. I see only HardwareSerial2.cpp and HardwareSerial4.cpp have the MICROMOD distinction, and basically they say:
  • Serial4 pins for T4.1 (16,17) become Serial2 on Micromod
  • Serial2 pins for T4.1 ( 7 , 8) become Serial4 on Micromod
That Hardware Serial Ports ref table could do with a Micromod column, or at least a sentence mentioning the Serial2 <> Serial4 swap.
 
That Hardware Serial Ports ref table could do with a Micromod column, or at least a sentence mentioning the Serial2 <> Serial4 swap.
I agree with you as well as other tables that have T4.x boards on it.

But, the Micromod is a Sparkfun product. They do have some information up on their website:

Not sure what PJRC and Sparkfun's agreement is on things like this might be....
 
Back
Top