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

Thread: Teensy 4.1 PSRAM and UART1 share pins right?

  1. #1
    Senior Member
    Join Date
    Oct 2020
    Posts
    157

    Teensy 4.1 PSRAM and UART1 share pins right?

    I'm reading the back of my Teensy 4.1 card and realized that the PSRAM slot has two of its pins (D0, CLK) marked next to greyed out RX1 and TX1. I assume that these QSPI and UART1 features are on the same pins. So if I intend to add PSRAM or extra FLASH, I should not use Serial1, SPI2, UART8 (RX8 is CS0), or I2C1 (SCL1 is CS1), correct?

    Also, RX1 and TX1 are marked as pins 0 and 1 on the front side of the card. I suppose pins 0 and 52 are the same physical pin, and if I use them as GPIOs, I can use either 0 or 52, correct? Thanks.

  2. #2
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    4,159
    Quote Originally Posted by liudr View Post
    I'm reading the back of my Teensy 4.1 card and realized that the PSRAM slot has two of its pins (D0, CLK) marked next to greyed out RX1 and TX1. I assume that these QSPI and UART1 features are on the same pins. So if I intend to add PSRAM or extra FLASH, I should not use Serial1, SPI2, UART8 (RX8 is CS0), or I2C1 (SCL1 is CS1), correct?

    Also, RX1 and TX1 are marked as pins 0 and 1 on the front side of the card. I suppose pins 0 and 52 are the same physical pin, and if I use them as GPIOs, I can use either 0 or 52, correct? Thanks.
    I believe it is like the Teensy 3.x, where there are certain pins used by the hardware by default, but you can tell the library to use the alternate pins.


  3. #3
    Junior Member
    Join Date
    May 2021
    Posts
    12
    Some of the functions you mentioned (like RX1, TX1) can be mapped to different pins.
    Every pin on the Teensy is a seperate pin on the MIMXRT1062. So no, pins 0 and pin 52 are not physically connected

  4. #4
    Senior Member
    Join Date
    Oct 2020
    Posts
    157
    Thanks. So these uart functions can be connected to any pins (via a matrix like ESP32) or only a few alternate pins for each UART function? I also saw a term xbar, sounds like it's inverting signals on either CTS or RX. That's probably not related to alternate pins, right?

  5. #5
    Senior Member
    Join Date
    Oct 2020
    Posts
    157
    So what does the meaning of the greyed out RX1 and TX1 next to 52 and 53 on the back side of the 4.1 card? 52 and 53 are the alternate pins for RX1 and TX1? Thanks.

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    26,214
    Serial1 will default to pins 0 & 1. So no worries on PSRAM. Only a problem if you use Serial1.setRX(52) or Serial1.setTX(53) to switch to the alternate pins.

    Full hardware serial documentation is here:

    https://www.pjrc.com/teensy/td_uart.html

  7. #7
    Senior Member
    Join Date
    Oct 2020
    Posts
    157
    Did you just edit that file @Paul? Cause I had it open on one tab and it didn't have the 52 or 53 with 0 or 1. So two alternate pins for some UART ports, thanks!

  8. #8
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    26,214
    Yes, recently edited, also with a link to the thread about how to enable faster than 6 Mbit baud rates.

  9. #9
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    4,159
    Quote Originally Posted by liudr View Post
    Thanks. So these uart functions can be connected to any pins (via a matrix like ESP32) or only a few alternate pins for each UART function? I also saw a term xbar, sounds like it's inverting signals on either CTS or RX. That's probably not related to alternate pins, right?
    You can only switch to specific pins. I.e. you can switch Serial1 TX to 53 and Serial1 RX to 52 but not random other pins.

  10. #10
    Senior Member
    Join Date
    Oct 2020
    Posts
    157
    Got it thanks again!

  11. #11
    Senior Member
    Join Date
    Oct 2020
    Posts
    157
    So since we are on the UART topic, I have a couple of additional questions:

    1. I read that RTS and CTS can be assigned after Serialn.begin() and can attach any pin for the job, is that right? I want to use some of these UART ports with MAX3232 to talk to older RS232 devices, such as old printers, some of which use DTR/DSR but they seem to work the same way as RTS/CTS pair. Some of the devices have their DTR and RTS interconnected so when the device say printer can't accept more data, both DTR and RTS go high (I believe).

    2. The baud rate table doesn't have Teensy 4.x. I'm interested in low rates such as 1200 for older RS232 devices. I could bust out my logic analyzer or scope for that matter but would appreciate a confirmation that it would "probably" work.

    3. Any XON/XOFF support? I didn't see that in the doc but don't mind hacking source code to get the feature. I'm sure the hardware is capable. Probably just a couple of bits in the .begin() argument. Some older printers use it.

  12. #12
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    10,337
    Quote Originally Posted by liudr View Post
    So since we are on the UART topic, I have a couple of additional questions:

    1. I read that RTS and CTS can be assigned after Serialn.begin() and can attach any pin for the job, is that right? I want to use some of these UART ports with MAX3232 to talk to older RS232 devices, such as old printers, some of which use DTR/DSR but they seem to work the same way as RTS/CTS pair. Some of the devices have their DTR and RTS interconnected so when the device say printer can't accept more data, both DTR and RTS go high (I believe).

    2. The baud rate table doesn't have Teensy 4.x. I'm interested in low rates such as 1200 for older RS232 devices. I could bust out my logic analyzer or scope for that matter but would appreciate a confirmation that it would "probably" work.

    3. Any XON/XOFF support? I didn't see that in the doc but don't mind hacking source code to get the feature. I'm sure the hardware is capable. Probably just a couple of bits in the .begin() argument. Some older printers use it.
    Note there is additional information up on unofficial wiki:
    https://github.com/TeensyUser/doc/wi...er-transmitter
    That answers some of this.

Posting Permissions

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