baccandr (Customer) asked a question.

P1AM-200: Using TTL UART through P1AM-GPIO alongside P1AM-SERIAL RS-485

Hi everyone,

I was directed to this forum for advice on using a P1AM-200 with both P1AM-GPIO and P1AM-SERIAL shields.

I would like to connect two sensors simultaneously:

- A 3.3 V TTL UART sensor through the P1AM-GPIO.

- An RS-485 sensor through one port of the P1AM-SERIAL.

I already tried using GPIO pins 13 (RX) and 14 (TX) for the TTL sensor with the P1AM-SERIAL shield connected, but they were not operational. This is consistent with the note in the P1AM-SERIAL manual ("If a P1AM-GPIO module is installed alongside a P1AM-SERIAL module, the above pins will be unavailable to the P1AM-GPIO.")

Since I only need one RS-485 port, is there a supported way to use the other hardware UART’s TX/RX pins for TTL communication through the GPIO shield?

Specifically:

- Can an unused P1AM-SERIAL port be disabled or isolated to free its hardware TX/RX pins?

- Is there a software configuration or jumper setting that allows this, or would it require a hardware modification?

- Is there another recommended way to access a hardware UART while keeping one P1AM-SERIAL port operational?

My preference is to use hardware TX/RX. If that isn’t possible, I’ll consider software serial on spare GPIO pins, potentially using SoftwareSerialM (https://github.com/FYSETC/SoftwareSerialM), which includes SAMD51 support. Has anyone successfully used this library, or a similar solution, on the P1AM-200 alongside RS-485 communication?

 

Thanks for any advice!


  • baccandr (Customer)

    Thanks, I found an alternative that works without hardware modification (based on the P1AM-SERIAL Rev C schematic):

    1. pinMode(3, OUTPUT); digitalWrite(3, LOW); // Port 1 → RS-485 mode (routes RX_13 to the RS-485 transceiver)
    2. pinMode(A6, OUTPUT); digitalWrite(A6, HIGH); // RS-485 transceiver in transmit mode → its receiver output goes high-Z, releasing RX_13

    This lets me use Serial1 on pins 13/14 (via the P1AM-GPIO) for a 3.3 V TTL sensor, and Port 2 of the P1AM-SERIAL for RS-485.

    There seems to be only a few minor caveats with this approach:

    • A 1.2 kΩ pull-up (R15) remains on RX; the sensor's TX must sink ~2.75 mA when low. Mine seems to handle it fine.
    • Serial1 TX data is also transmitted as RS-485 on Port 1's terminals.
    • Don't use the Port 1 library functions, as they toggle A6.

    Did I miss anything? I am open to suggestions if anybody has a better way to handle this.

     

    Thanks

    Andrea

    Expand Post