Roadrunner technical documentation Buy

How to use the SPI ports

This article illustrates how to use the SPI ports on Acme Systems Road Runner SOM based on Microchip SAMA5D27 MPU

Pinout of SPI ports

The SPI bus lines are located on the following pins:

| Signal     | Per A | Per B | Per C | Per D | Per E | Per F 
|------------|-------|-------|-------|-------|-------|-------
| SPI0 MOSI  | PA15  |       | PB0   |       |       |       
| SPI0 MISO  | PA16  |       | PA31  |       |       |       
| SPI0 SCLK  | PA14  |       | PB1   |       |       |       
| SPI0 CS0   | PA17  |       | PA30  |       |       |      
| SPI0 CS1   | PA18  |       | PA29  |       |       |      
| SPI0 CS2   | PA19  |       | PA27  |       |       |      
| SPI0 CS3   | PA20  |       | PA28  |       |       |       
!------------|-------|-------|-------|-------|-------|-------
| SPI1 MOSI  | PD26  |       |       | PC2   | PA23  |       
| SPI1 MISO  | PD27  |       |       | PC3   | PA24  |       
| SPI1 SCLK  | PD25  |       |       | PC1   | PA25  |       
| SPI1 CS0   | PD28  |       |       | PC4   | PA22  |       
| SPI1 CS1   | PD29  |       |       | PC5   | PA26  |       
| SPI1 CS2   | PD30  |       |       | PC6   | PA27  |       
| SPI1 CS3   |       |       |       | PC7   | PA28  |       
|------------|-------|-------|-------|-------|-------|-------

Kernel configuration

Device Drivers  --->
  [*] SPI support  ---> 
    <*>   Atmel SPI Controller 
    <*>   User mode SPI device driver support

Device tree

/****************/      
/* Enable SPI 0 */
/****************/      

spi0: spi@f8000000 {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_spi0_default>;
    status = "okay";

    spidev@0 {
       compatible = "linux,spidev";
       spi-max-frequency = <10000000>;
       reg = <0>;
    };
};

/* Pin definition Peripheral A */

pinctrl_spi0_default: spi0_default {
    pinmux = <PIN_PA14__SPI0_SPCK>,
            <PIN_PA15__SPI0_MOSI>,
            <PIN_PA16__SPI0_MISO>,
            <PIN_PA17__SPI0_NPCS0>,
            <PIN_PA18__SPI0_NPCS1>,
            <PIN_PA19__SPI0_NPCS2>,
            <PIN_PA20__SPI0_NPCS3>;
    bias-disable;
};

/****************/      
/* Enable SPI 1 */
/****************/      

spi1: spi@fc000000 {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_spi1_default>;
    status = "okay";

    spidev@0 {
       compatible = "linux,spidev";
       spi-max-frequency = <10000000>;
       reg = <0>;
    };

};

/* Pin definition Peripheral D */

pinctrl_spi1_default: spi1_default {
    pinmux = <PIN_PC1__SPI1_SPCK>,
    <PIN_PC2__SPI1_MOSI>,
    <PIN_PC3__SPI1_MISO>,
    <PIN_PC4__SPI1_NPCS0>;
    bias-disable;
};

Links

Related products

RoadRunner D2

Info Doc Buy

  • CPU Microchip SAMA5D27
  • Cortex A5 @ 500 MHz
  • Very low power consumption:
    396mW in full speed mode
    198mW at Linux prompt
    17mW in standby mode
    10mW in suspend to RAM mode
  • Armhf architecture
  • DDR3L RAM 256 MB
  • QuadSPI 0/16/64/128MB
  • Size: 40x30 mm
  • Plug-in module
  • 200 pins 0.4 mm pitch
  • TFT parallel interface
  • Boot from internal Quad SPI or external uSD/eMMC
  • Linux Kernel 5.15 LTS
  • Debian, Buildroot and Yocto
  • Open source drivers
H10

Info Doc Buy

  • Single Board Computer based on RoadRunner Linux SOM (Included)
  • Classic "Credit Card" form factor
  • Two USB Host 2.0 ports (one configurable as USB client on the USB-C connector)
  • One 10/100 Mbit/s Lan port
  • Two AcmeSensor ports
  • Double placements for 2.54mm pitch 20x2 pinstrips (not soldered) for GPIOS, SPI, I2C, Serial etc ports
  • Credit Card footprint

Info Buy

  • All the circuitries you need to test the RoadRunner SOM
  • USB host, USB device, Ethernet port, MicroSD socket
  • Test points for power consumption measurements
  • All the Roadrunner signals exposed on 2.54mm pitch pins
  • On-board supercap for RTC and backup memory circuit

Home page Roadrunner technical documentation Buy