MCUXpresso SDK Documentation

dspi_interrupt

dspi_interrupt#

Overview#

The dspi_interrupt example shows how to use DSPI driver in interrupt way:

In this example , one dspi instance used as DSPI master and another dspi instance used as DSPI slave in the same board. This example does not use the transactional API in DSPI driver. It’s a demonstration that how to use the interrupt in KSDK driver.

  1. DSPI master send/received data to/from DSPI slave in interrupt . (DSPI Slave using interrupt to receive/send the data)

Supported Boards#

FRDM-K22F
Hardware requirements
  • Mini/micro USB cable

  • FRDM-K22F board

  • Personal Computer

Board settings

SPI one board: Transfer data from instance0 to instance 1 of SPI interface. SPI0 pins are connected with SPI1 pins of board

INSTANCE0(SPI0)     CONNECTS TO         INSTANCE1(SPI1)
Pin Name   Board Location     Pin Name  Board Location
MISO       J1 pin 11           MISO      J2 pin 8
MOSI       J1 pin 16           MOSI      J2 pin 10
SCK        J1 pin 15           SCK       J2 pin 12
PCS0       J24 pin 9           PCS0      J2 pin 6
Prepare the Demo
  1. Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.

  2. Open a serial terminal on PC for OpenSDA serial device with these settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Reset the SoC and run the project.

Running the demo

When the demo runs successfully, the log would be seen on the OpenSDA terminal like:

dspi_functional_interrupt example start.
This example use one dspi instance as master and another as slave on one board.
Master and slave are both use interrupt way.
Please make sure you make the correct line connection. Basically, the connection is:

DSPI_master -- DSPI_slave

   CLK      --    CLK
   PCS      --    PCS
   SOUT     --    SIN
   SIN      --    SOUT

DSPI transfer all data matched!