EIglesias (Customer) asked a question.

SPI Pin Conflicts and Integration Challenges with P1AM-100, P1AM-Serial, P1AM-Eth, P1-04TRS, and MKR CAN Shield

I’m currently working on a project using the P1AM-100 along with several expansion modules:

  • MKR CAN Shield
  • P1AM-Serial
  • P1AM-Eth
  • P1-04TRS

I’m running into some issues related to SPI pin conflicts and integrating all the modules together. I’m hoping to get some guidance from anyone who has done a similar multi-shield setup.

SPI pin assignments:

  • CAN_CS_PIN = 4, INT = 7, SCK = 9, MOSI = 8, MISO = 10
  • ETH_CS_PIN = 5, SCK = 9, MOSI = 8, MISO = 10
  • Serial_Port1: RS232/485Sel = 3, RX = 13, Tx = 14, RS485 DE/RE = A6
  • Serial_Port2: RS232/485Sel = 2, RX = 1, Tx = 0, RS485 DE/RE = 6
  • Base_Controller: CS = A3, ACK = A4, SCK = 9, MOSI = 8, MISO = 10

Integration complexity:

  • Getting CAN, Ethernet (Modbus TCP), and RS485 (Modbus RTU) all running reliably on the same board has been tricky.

Questions for the community:

  • Are there best practices for combining P1AM modules with MKR CAN Shield?
  • Any tips for avoiding SPI conflicts or managing multiple SPI devices with the P1AM-100?
  • Any recommended workflow for integrating Modbus TCP + Modbus RTU + CAN on a single P1AM setup?

Any insight or guidance would be greatly appreciated!


  • FACTS_AdamC (AutomationDirect)

    Hey @EIglesias (Customer)​ ,

     

    I want to double check you're using the official Arduino MKR CAN shield - if so I believe the CS pin is actually 3 and not 4. Unfortunately this does create a conflict with the P1AM-SERIAL that could be an issue if you're running an RTU Server as toggling the CAN CS would change from 232-485 mode. There is the possibility of modifying the hardware/library of the MKR CAN shield by cutting the pin trace on 3 and jumpering it to 4 in addition to altering the code to reflect this change.

     

    For general advice on getting all of these running together I would recommend

    1. For any SPI device, ensure all CS pins are set HIGH before trying to use the devices. Without doing so, theres a chance multiple chips will be active on the SPI bus corrupting comms
    2. Have a clear plan on marshalling messages from the CAN, RTU, and TCP sources. The P1AM-100 is a single core and single thread system so you'll have to be servicing each of these individually. Plan any timeouts or retries with this in mind

     

    Thanks

    Adam

    Expand Post