StormTech (Customer) asked a question.

USB Host Shield via SPI Pins

I posted in the Arduino forum but have no response.

 

Back Ground: I have a Mega2560 and a USB host shield reading in ASCII from an analyzer. The analyzer has an onboard Silicon labs chip (CP210x). I currently have a library that includes the CP210x driver which then uses my code to send and receive commands with a response.

 

I would like to use the P1AM to do the same but I can't seem to find the right library or documentation to obtain a working project. I have a USB shield connected to the SPI pins (8,9,10) of the P1MA with the select pin on 7.

 

How would I go about migrating from the Mega to the P1AM? Note that I am using a "Host Sheild" and not trying to use the native USB port. I will end up using it for debugging.


  • FACTS_MikeSc (AutomationDirect)

    The P1AM-100 has pretty much the same library compatibility that the MKR Zero is compatible with. Both use the SAMD21.

     

    From a quick look of the hardware differences the Mega2560 is not comparable to ours. The library for the Arduino USB Host Shield doesn't list any support for the MKR devices.

  • FACTS_MikeSc (AutomationDirect)

    You could try the Arduino Discord server to see if anyone has some suggestions.

  • StormTech (Customer)

    In my research yesterday and this morning it appears that the SAMD21 series does not play well with the MAX3421E chip which is the heart to the USB host shield. Although not sure why because it just uses SPI communication protocol. Writing the libraries and such is beyond my expertise.

     

    Thanks for the assistance.

      • StormTech (Customer)

        I tried that library, but it won't compile, as it asks to select USB Stack. If I switch back to a Feather M0 (Samd21) the menu changes and I can select the USB Stack. I'm not sure how to #define the USB Stack if I have the P1AM selected as the board?Snip 

        "Documents\Arduino\libraries\Adafruit_TinyUSB_Library\src/arduino/Adafruit_TinyUSB_API.h:50:2: error: #error TinyUSB is not selected, please select it in "Tools->Menu->USB Stack" #error TinyUSB is not selected, please select it in "Tools->Menu->USB Stack"

        Expand Post