MG (Customer) asked a question.

Possible to use MKR CAN Shield with P1AM? Uses SPI (pins 8-10)

I'm spec'ing out a project and it will involve at least 1 CAN bus, and the MKR CAN shields use SPI to communicate, which are pins 8, 9, 10 of the header connection. It very clearly says in the P1AM documentation that these pins are used for the base controller. Does this mean that these pins are off limits to other shields? I assume the base controller is also using these pins for SPI so is there some form of compatibility or things to watch out for, or is it just a "no touchy" situation?

 

Thanks!


  • FACTS_AdamC (AutomationDirect)

    You should be good to go in this case. More info below.

     

    SPI signals MOSI, MISO, and SCLK (8, 9 and 10 for us), can be shared between devices. The only pin that needs to be unique per device is the CS pin. It looks like the CAN shield uses pin 3 for CS. When CS is low, the device knows the master is talking to it. If you are using a P1AM-GPIO shield, make sure nothing is connected to pin 3.

     

     

     

    Expand Post
    • MG (Customer)

      Fast and fantastic reply. Thank you.

       

      So if I needed multiple CAN buses it would be better to use something like these, and put them inside of a P1AM-PROTO, keep all the MOSI, MISO, SCLK wired in parallel to each, but make sure there CS pins are unique, and then likely update the library to make sure the correct pin gets pulled low depending on which CAN interface the master is talking to?

       

      Thanks again!

      Expand Post
  • z28z34man (Customer)

    The P1AM is 3.3 V and the MCP2525 appears to be 5V. i am not sure if the board you linked to an amazon will work with the P1AM

    • MG (Customer)

      Very good point, and I did notice in the README for the ArduinoCAN library that it mentions if using a 3.3V controller a logic level converter will be necessary. Good information to add to this thread. Thanks!

      • FACTS_AdamC (AutomationDirect)

        Interesting they make that statement since it looks like it largely depends on the supply voltage; better safe than smoking I suppose.

         

        The MKRCAN board itself goes directly into the MCP2515 without conversionmkr_can

        Expand Post