lpspi_interrupt_b2b_slave#
Overview#
The lpspi_interrupt_b2b example shows how to use LPSPI driver in interrupt way.
In this example, we need two boards, one board used as LPSPI master and another board used as LPSPI slave. The file ‘lpspi_interrupt_b2b_slave.c’ includes the LPSPI slave code. This example does not use the transactional API in LPSPI driver. LPSPI master send/received data to/from LPSPI slave in interrupt. (LPSPI Slave using interrupt to receive/send the data)
Running the demo#
When the demo runs successfully, you will see output in the terminal like this:
LPSPI interrupt board to board (b2b) slave example.
Slave example is running...
Slave transmit:
1 2 3 4 5 6 7 8 9 A B C D E F 10
11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20
21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30
31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40
LPSPI transfer all data matched!
Slave received:
1 2 3 4 5 6 7 8 9 A B C D E F 10
11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20
21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30
31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40
Slave example is running...
Supported Boards#
EVK9-MIMX8ULP
Hardware requirements
Micro USB cable
two MIMX8ULP-EVK/EVK9 boards
J-Link Debug Probe
5V power supply
Personal Computer
Board settings
Remove R139, R159 and populate R140, R158 on both base boards.
SPI two boards: Transfer data from one board instance to another board’s instance. SPI1 pins are connected with SPI1 pins of another board
INSTANCE0(SPI1) CONNECTS TO INSTANCE0(SPI1)
Pin Name Board Location Pin Name Board Location
SPI1_SCK J23 pin 4 SPI1_SCK J23 pin 4
SPI1_SIN J23 pin 2 SPI1_SOUT J23 pin 3
SPI1_SOUT J23 pin 3 SPI1_SIN J23 pin 2
SPI1_PCS0 J23 pin 1 SPI1_PCS0 J23 pin 1
GND GND
Prepare the Demo
Connect 5V power supply and J-Link Debug Probe to the board, switch SW10 to power on the board.
Connect a micro USB cable between the host PC and the J17 USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either cold boot your board or launch the debugger in your IDE to begin running the example.
IMX952LPD5EVK-19
Hardware requirements
Micro USB cable
two IMX952-EVK boards
J-Link Debug Probe
12V~20V power supply
Personal Computer
Board settings
set SW1 into 0000 on IMX952-EVK
Transfer data from one board instance to another board’s instance. SPI7 pins are connected with SPI7 pins of another board
INSTANCE0(SPI7) CONNECTS TO INSTANCE0(SPI7)
Pin Name Board Location Pin Name Board Location
SPI_SCK IMX952LPD5EVK-19 JP1 pin 5 SPI7_SCK IMX952LPD5EVK-19 JP1 pin 5
SPI_SIN IMX952LPD5EVK-19 JP1 pin 3 SPI7_SOUT IMX952LPD5EVK-19 JP1 pin 4
SPI_SOUT IMX952LPD5EVK-19 JP1 pin 4 SPI7_SIN IMX952LPD5EVK-19 JP1 pin 3
SPI_PCS0 IMX952LPD5EVK-19 JP1 pin 2 SPI7_PCS0 IMX952LPD5EVK-19 JP1 pin 2
GND GND
Prepare the Demo
Connect 12V~20V power supply and J-Link Debug Probe to the board, switch SW4 to power on the board.
Connect a micro USB cable between the host PC and the J31 USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either cold boot your board or launch the debugger in your IDE to begin running the example.
Running the demo
When the demo runs successfully, the log would be seen on the terminal like:
LPSPI board to board functional interrupt example.
Slave start to receive data...
LPSPI transfer all data matched!
Slave received:
0 1 2 3 4 5 6 7 8 9 A B C D E F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
End of slave example!
EVKB-IMXRT1050
Hardware requirements
Mini/micro USB cable
Two EVKB-IMXRT1050 boards
Personal Computer
Board settings
Weld 0Ω resistor to R278,R279,R280,R281.
SPI two boards: Transfer data from one board instance to another board’s instance. SPI0 pins are connected with SPI0 pins of another board
INSTANCE1(LPSPI1) CONNECTS TO INSTANCE1(LPSPI1)
Pin Name Board Location Pin Name Board Location
SOUT J24 pin 4 SIN J24 pin 5
SIN J24 pin 5 SOUT J24 pin 4
SCK J24 pin 6 SCK J24 pin 6
PCS0 J24 pin 3 PCS0 J24 pin 3
GND J24 pin 7 GND J24 pin 7
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
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
Download the program to the target board.
Reset the SoC and run the project.
MIMXRT1060-EVKB
Hardware requirements
Mini/micro USB cable
MIMXRT1060-EVKB board
Personal Computer
Board settings
Remove the resistor R347,R348,R349,R351,R363,R364,R365. Weld 0Ω resistor to R346,R350,R356,R362.
SPI two boards: Transfer data from one board instance to another board’s instance. SPI0 pins are connected with SPI0 pins of another board
INSTANCE0(SPI0) CONNECTS TO INSTANCE0(SPI0)
Pin Name Board Location Pin Name Board Location
SOUT J17 pin 4 SIN J17 pin 5
SIN J17 pin 5 SOUT J17 pin 4
SCK J17 pin 6 SCK J17 pin 6
PCS0 J17 pin 3 PCS0 J17 pin 3
GND J17 pin 7 GND J17 pin 7
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
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
Download the program to the target board.
Reset the SoC and run the project.
Note: Please ensure not to insert any SD CARD device on two boards
MIMXRT1170-EVKB
Hardware requirements
Mini/micro USB cable
MIMXRT1170-EVKB board
Personal Computer
Board settings
Remove 0Ω resistors R200,R404,R406,R2016,R2097.
SPI two boards: Transfer data from one board instance to another board’s instance. SPI1 pins are connected with SPI1 pins of another board
INSTANCE1(LPSPI1) CONNECTS TO INSTANCE1(LPSPI1)
Pin Name Board Location Pin Name Board Location
SOUT J10 pin 8 SIN J10 pin 10
SIN J10 pin 10 SOUT J10 pin 8
SCK J10 pin 12 SCK J10 pin 12
PCS0 J10 pin 6 PCS0 J10 pin 6
GND J10 pin 14 GND J10 pin 14
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
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
Download the program to the target board.
Reset the SoC and run the project.
MIMXRT1060-EVKC
Hardware requirements
Mini/micro USB cable
MIMXRT1060-EVKC board
Personal Computer
Board settings
Remove the resistor R347,R348,R349,R351,R363,R364,R365. Weld 0Ω resistor to R346,R350,R356,R362.
SPI two boards: Transfer data from one board instance to another board’s instance. SPI0 pins are connected with SPI0 pins of another board
INSTANCE0(SPI0) CONNECTS TO INSTANCE0(SPI0)
Pin Name Board Location Pin Name Board Location
SOUT J17 pin 4 SIN J17 pin 5
SIN J17 pin 5 SOUT J17 pin 4
SCK J17 pin 6 SCK J17 pin 6
PCS0 J17 pin 3 PCS0 J17 pin 3
GND J17 pin 7 GND J17 pin 7
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
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
Download the program to the target board.
Reset the SoC and run the project.
Note: Please ensure not to insert any SD CARD device on two boards
FRDM-IMXRT1152
Hardware requirements
Type-C USB cable
FRDM-IMXRT1152 board
Personal Computer
Board settings
SPI two boards: Transfer data from one board instance to another board’s instance. SPI1 pins are connected with SPI1 pins of another board
INSTANCE1(LPSPI1) CONNECTS TO INSTANCE1(LPSPI1)
Pin Name Board Location Pin Name Board Location
SOUT J11 pin 8 SIN J11 pin 10
SIN J11 pin 10 SOUT J11 pin 8
SCK J11 pin 12 SCK J11 pin 12
PCS0 J11 pin 6 PCS0 J11 pin 6
GND J11 pin 14 GND J11 pin 14
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
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
Download the program to the target board.
Reset the SoC and run the project.
EVK-MCIMX7ULP
Hardware requirements
Micro USB cable
two MCIMX7ULP-EVK boards
J-Link Debug Probe
5V power supply
Personal Computer
Board settings
Populate R188, R189, R190, R191 on both base boards.
SPI two boards: Transfer data from one board instance to another board’s instance. SPI1 pins are connected with SPI1 pins of another board
INSTANCE0(SPI1) CONNECTS TO INSTANCE0(SPI1)
Pin Name Board Location Pin Name Board Location
SPI1_SCK J8 pin 6 SPI1_SCK J8 pin 6
SPI1_SIN J8 pin 5 SPI1_SOUT J8 pin 4
SPI1_SOUT J8 pin 4 SPI1_SIN J8 pin 5
SPI1_PCS0 J8 pin 3 SPI1_PCS0 J8 pin 3
GND GND
Please note this application can’t support running with Linux BSP! Note
Because of the LPSPI signal pin allocating issue, you can not restart this demo/example by press the ResetButton(SW3):
The LPSPI1_SIN, LPSPI1_SOUT, LPSPI1_SCK and LPSPI1_PCS0 pins are connected to PTA12, PTA13, PTA14 and PTA15 pads.
These pins are also used as BOO_CFG12, BOO_CFG13, BOO_CFG14 and BOO_CFG15 when the i.MX SoC reboot. These signals are
driven by LPSPI1 pins on the other board, when user press ResetButton. This may cause M4 Core enter enter
incorrect boot modes and only re-powerup both boards can let the M4 core exit such modes.
##### Prepare the Demo
1. Connect 5V power supply and J-Link Debug Probe to the board, switch SW1 to power on the board.
2. Connect a micro USB cable between the host PC and the J6 USB port on the target board.
3. Open a serial terminal with the following settings:
- 115200 baud rate
- 8 data bits
- No parity
- One stop bit
- No flow control
4. Download the program to the target board.
5. Either cold boot your board or launch the debugger in your IDE to begin running the example.
EVK-MIMX8ULP
Hardware requirements
Micro USB cable
two MIMX8ULP-EVK/EVK9 boards
J-Link Debug Probe
5V power supply
Personal Computer
Board settings
Remove R139, R159 and populate R140, R158 on both base boards.
SPI two boards: Transfer data from one board instance to another board’s instance. SPI1 pins are connected with SPI1 pins of another board
INSTANCE0(SPI1) CONNECTS TO INSTANCE0(SPI1)
Pin Name Board Location Pin Name Board Location
SPI1_SCK J23 pin 4 SPI1_SCK J23 pin 4
SPI1_SIN J23 pin 2 SPI1_SOUT J23 pin 3
SPI1_SOUT J23 pin 3 SPI1_SIN J23 pin 2
SPI1_PCS0 J23 pin 1 SPI1_PCS0 J23 pin 1
GND GND
Prepare the Demo
Connect 5V power supply and J-Link Debug Probe to the board, switch SW10 to power on the board.
Connect a micro USB cable between the host PC and the J17 USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either cold boot your board or launch the debugger in your IDE to begin running the example.
EVK-MIMXRT1010
Hardware requirements
Mini/micro USB cable
EVK-MIMXRT1010 board
Personal Computer
Board settings
SPI two boards: Transfer data from one board instance to another board’s instance. SPI1 pins are connected with SPI1 pins of another board
MASTER connect to SLAVE
Pin Name Board Location Pin Name Board Location
SOUT J57-10 SIN J57-8
SIN J57-8 SOUT J57-10
SCK J57-12 SCK J57-12
PCS0 J57-6 PCS0 J57-6
GND J57-14 GND J57-14
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
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
Download the program to the target board.
Reset the SoC and run the project.
Note: To debug in qspiflash, following steps are needed:
Select the flash target and compile.
Set the SW8: 1 off 2 off 3 on 4 off, then power on the board and connect USB cable to J41.
Start debugging in IDE.
Keil: Click “Download (F8)” to program the image to qspiflash first then clicking “Start/Stop Debug Session (Ctrl+F5)” to start debugging.
EVK-MIMXRT1015
Hardware requirements
Mini/micro USB cable
EVK-MIMXRT1015 board
Personal Computer
Board settings
Remove R293 SPI two boards: Transfer data from one board instance to another board’s instance. SPI1 pins are connected with SPI1 pins of another board
MASTER connect to SLAVE
Pin Name Board Location Pin Name Board Location
SOUT J19-4 SIN J19-5
SIN J19-5 SOUT J19-4
SCK J19-6 SCK J19-6
PCS0 J19-3 PCS0 J19-3
GND J19-7 GND J19-7
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
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
Download the program to the target board.
Reset the SoC and run the project.
Note: To debug in qspiflash, following steps are needed:
Select the flash target and compile.
Set the SW8: 1 off 2 off 3 on 4 off, then power on the board and connect USB cable to J41.
Start debugging in IDE.
Keil: Click “Download (F8)” to program the image to qspiflash first then clicking “Start/Stop Debug Session (Ctrl+F5)” to start debugging.
EVK-MIMXRT1020
Hardware requirements
Mini/micro USB cable
EVK-MIMXRT1020 board
Personal Computer
Board settings
SPI two boards: Transfer data from one board instance to another board’s instance. SPI1 pins are connected with SPI1 pins of another board
MASTER connect to SLAVE
Pin Name Board Location Pin Name Board Location
SOUT J19-4 SIN J19-5
SIN J19-5 SOUT J19-4
SCK J19-6 SCK J19-6
PCS0 J19-3 PCS0 J19-3
GND J19-7 GND J19-7
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
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
Download the program to the target board.
Reset the SoC and run the project.
Note: To debug in qspiflash, following steps are needed:
Select the flash target and compile.
Set the SW8: 1 off 2 off 3 on 4 off, then power on the board and connect USB cable to J23.
Start debugging in IDE.
Keil: Click “Download (F8)” to program the image to qspiflash first then clicking “Start/Stop Debug Session (Ctrl+F5)” to start debugging.
MIMXRT1024-EVK
Hardware requirements
Mini/micro USB cable
MIMXRT1024-EVK board
Personal Computer
Board settings
SPI two boards: Transfer data from one board instance to another board’s instance. SPI1 pins are connected with SPI1 pins of another board
MASTER connect to SLAVE
Pin Name Board Location Pin Name Board Location
SOUT J19-8 SIN J19-10
SIN J19-10 SOUT J19-8
SCK J19-12 SCK J19-12
PCS0 J19-6 PCS0 J19-6
GND J19-14 GND J19-14
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
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
Download the program to the target board.
Reset the SoC and run the project.
Note: To debug in qspiflash, following steps are needed:
Select the flash target and compile.
Set the SW8: 1 off 2 off 3 on 4 off, then power on the board and connect USB cable to J23.
Start debugging in IDE.
Keil: Click “Download (F8)” to program the image to qspiflash first then clicking “Start/Stop Debug Session (Ctrl+F5)” to start debugging.
MIMXRT1040-EVK
Hardware requirements
Mini/micro USB cable
MIMXRT1040-EVK board
Personal Computer
Board settings
Weld 0Ω resistor to R346,R350,R356,R362.
SPI two boards: Transfer data from one board instance to another board’s instance. SPI0 pins are connected with SPI0 pins of another board
INSTANCE0(SPI0) CONNECTS TO INSTANCE0(SPI0)
Pin Name Board Location Pin Name Board Location
SOUT J17 pin 4 SIN J17 pin 5
SIN J17 pin 5 SOUT J17 pin 4
SCK J17 pin 6 SCK J17 pin 6
PCS0 J17 pin 3 PCS0 J17 pin 3
GND J17 pin 7 GND J17 pin 7
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
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
Download the program to the target board.
Reset the SoC and run the project.
EVK-MIMXRT1064
Hardware requirements
Mini/micro USB cable
EVK-MIMXRT1064 board
Personal Computer
Board settings
Weld 0Ω resistor to R278,R279,R280,R281.
SPI two boards: Transfer data from one board instance to another board’s instance. SPI0 pins are connected with SPI0 pins of another board
INSTANCE0(SPI0) CONNECTS TO INSTANCE0(SPI0)
Pin Name Board Location Pin Name Board Location
SOUT J24 pin 4 SIN J24 pin 5
SIN J24 pin 5 SOUT J24 pin 4
SCK J24 pin 6 SCK J24 pin 6
PCS0 J24 pin 3 PCS0 J24 pin 3
GND J24 pin 7 GND J24 pin 7
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
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
Download the program to the target board.
Reset the SoC and run the project.
MIMXRT1160-EVK
Hardware requirements
Mini/micro USB cable
MIMXRT1160-EVK board
Personal Computer
Board settings
Remove 0Ω resistors R200,R404,R406,R408.
SPI two boards: Transfer data from one board instance to another board’s instance. SPI1 pins are connected with SPI1 pins of another board
INSTANCE1(LPSPI1) CONNECTS TO INSTANCE1(LPSPI1)
Pin Name Board Location Pin Name Board Location
SOUT J10 pin 8 SIN J10 pin 10
SIN J10 pin 10 SOUT J10 pin 8
SCK J10 pin 12 SCK J10 pin 12
PCS0 J10 pin 6 PCS0 J10 pin 6
GND J10 pin 14 GND J10 pin 14
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
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
Download the program to the target board.
Reset the SoC and run the project.
MIMXRT1180-EVK
Hardware requirements
Mini/micro USB cable
MIMXRT1180-EVK board
Personal Computer
Board settings
SPI two boards: Transfer data from one board instance to another board’s instance. SPI3 pins are connected with SPI3 pins of another board
INSTANCE(LPSPI3) CONNECTS TO INSTANCE(LPSPI3)
Pin Name Board Location Pin Name Board Location
SOUT J44-8 SIN J44-10
SIN J44-10 SOUT J44-8
SCK J44-12 SCK J44-12
PCS0 J44-6 PCS0 J44-6
GND J44-14 GND J44-14
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
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
Download the program to the target board.
Reset the SoC and run the project.
FRDM-K32L2A4S
Hardware requirements
Mini USB cable
Two FRDM-K32L2A4S boards
Personal Computer
Board settings
SPI two boards: Transfer data from one board instance to another board’s instance. SPI0 pins are connected with SPI0 pins of another board
INSTANCE0(SPI0) CONNECTS TO INSTANCE0(SPI0)
Pin Name Board Location Pin Name Board Location
SOUT J2 pin 8 SIN J2 pin 10
SIN J2 pin 10 SOUT J2 pin 8
SCK J2 pin 12 SCK J2 pin 12
PCS0 J2 pin 6 PCS0 J2 pin 6
GND J2 pin 14 GND J2 pin 14
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
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
Download the program to the target board.
Reset the SoC and run the project.
FRDM-K32L3A6
Hardware requirements
Mini USB cable
Two FRDM-K32L3A6 boards
Personal Computer
Board settings
SPI two board: Transfer data from one board instance to another board’s instance. To make lpspi example work(M4), connections needed to be as follows: SPI0 pins are connected with SPI0 pins of another board
INSTANCE0(SPI0) CONNECTS TO INSTANCE0(SPI0)
Pin Name Board Location Pin Name Board Location
SOUT J2 pin 8 SIN J2 pin 10
SIN J2 pin 10 SOUT J2 pin 8
SCK J2 pin 12 SCK J2 pin 12
PCS2 J2 pin 6 PCS2 J2 pin 6
GND J2 pin 14 GND J2 pin 14
To make lpspi example work(M0), connections needed to be as follows: SPI3 pins are connected with SPI3 pins of another board
INSTANCE3(SPI3) CONNECTS TO INSTANCE3(SPI3)
Pin Name Board Location Pin Name Board Location
SOUT J1 pin 2 SIN J1 pin 6
SIN J1 pin 6 SOUT J1 pin 2
SCK J3 pin 5 SCK J3 pin 5
PCS1 J3 pin 9 PCS1 J3 pin 9
GND J2 pin 14 GND J2 pin 14
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
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
Download the program to the target board.
Reset the SoC and run the project.
FRDM-KE15Z
Hardware requirements
Micro USB cable
Two FRDM-KE15Z boards
Personal Computer
Board settings
SPI two boards: Transfer data from one board instance to another board’s instance. SPI0 pins are connected with SPI0 pins of another board
INSTANCE0(SPI0) CONNECTS TO INSTANCE0(SPI0)
Pin Name Board Location Pin Name Board Location
SOUT J2 pin 8 SIN J2 pin 10
SIN J2 pin 10 SOUT J2 pin 8
SCK J2 pin 12 SCK J2 pin 12
PCS3 J2 pin 6 PCS3 J2 pin 6
GND J2 pin 14 GND J2 pin 14
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
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
Download the program to the target board.
Reset the SoC and run the project.
FRDM-KE16Z
Hardware requirements
Micro USB cable
Two FRDM-KE16Z boards
Personal Computer
Board settings
SPI two boards: Transfer data from one board instance to another board’s instance. SPI0 pins are connected with SPI0 pins of another board
INSTANCE0(SPI0) CONNECTS TO INSTANCE0(SPI0)
Pin Name Board Location Pin Name Board Location
SOUT J4 pin 7 SIN J4 pin 5
SIN J4 pin 5 SOUT J4 pin 7
SCK J4 pin 3 SCK J4 pin 3
PCS3 J4 pin 6 PCS3 J4 pin 6
GND J2 pin 14 GND J2 pin 14
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
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
Download the program to the target board.
Reset the SoC and run the project.
FRDM-KE17Z
Hardware requirements
Micro USB cable
Two FRDM-KE17Z boards
Personal Computer
Board settings
SPI two boards: Transfer data from one board instance to another board’s instance. SPI0 pins are connected with SPI0 pins of another board
INSTANCE0(SPI0) CONNECTS TO INSTANCE0(SPI0)
Pin Name Board Location Pin Name Board Location
SOUT J2 pin 8 SIN J2 pin 10
SIN J2 pin 10 SOUT J2 pin 8
SCK J2 pin 12 SCK J2 pin 12
PCS1 J2 pin 6 PCS1 J2 pin 6
GND J2 pin 14 GND J2 pin 14
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
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
Download the program to the target board.
Reset the SoC and run the project.
FRDM-KE17Z512
Hardware requirements
Micro USB cable
Two FRDM-KE17Z512 boards
Personal Computer
Board settings
SPI two boards: Transfer data from one board instance to another board’s instance. SPI0 pins are connected with SPI0 pins of another board
INSTANCE0(SPI0) CONNECTS TO INSTANCE0(SPI0)
Pin Name Board Location Pin Name Board Location
SOUT J2 pin 8 SIN J2 pin 10
SIN J2 pin 10 SOUT J2 pin 8
SCK J2 pin 12 SCK J2 pin 12
PCS2 J2 pin 6 PCS2 J2 pin 6
GND J2 pin 14 GND J2 pin 14
Prepare the Demo
Connect a USB cable between the PC host and the MCU-LINK USB port on the board.
Open a serial terminal on PC for MCU-LINK serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Reset the SoC and run the project.
FRDM-MCXA153
Hardware requirements
Type-C USB cable
FRDM-MCXA153 board
Personal Computer
Board settings
LPSPI:
MASTER(SPI0) connect to SLAVE(SPI1)
Pin Name Board Location Pin Name Board Location
SOUT J6-6 SIN J2-10
SIN J6-5 SOUT J2-8
SCK J6-4 SCK J2-12
PCS0 J6-3 PCS1 J2-6
GND J6-8 GND J6-8
Prepare the Demo
Connect a Type-C USB cable between the host PC and the MCU-Link port(J15) on the target board.
Open a serial terminal on PC for MCU-Link serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
FRDM-MCXA156
Hardware requirements
Type-C USB cable
FRDM-MCXA156 board
Personal Computer
Board settings
LPSPI:
MASTER(SPI0) connect to SLAVE(SPI1)
Pin Name Board Location Pin Name Board Location
SOUT J6-6 SIN J3-9
SIN J6-5 SOUT J3-11
SCK J6-4 SCK J3-7
PCS0 J6-3 PCS1 J3-5
GND J6-8 GND J6-8
Prepare the Demo
Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.
Open a serial terminal on PC for MCU-Link serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
FRDM-MCXA346
Overview
The lpspi_interrupt_b2b example shows how to use LPSPI driver in interrupt way:
In this example , we need two boards , one board used as LPSPI master and another board used as LPSPI slave. The file ‘dspi_interrupt_b2b_slave.c’ includes the LPSPI slave code. This example does not use the transactional API in LPSPI driver. It’s a demonstration that how to use the interrupt in KSDK driver.
LPSPI master send/received data to/from LPSPI slave in interrupt . (LPSPI Slave using interrupt to receive/send the data)
Hardware requirements
Type-C USB cable
FRDM-MCXA346 board
Personal Computer
Board settings
LPSPI:
MASTER(SPI1) connect to SLAVE(SPI1)
Pin Name Board Location Pin Name Board Location
SOUT J2-8 SIN J2-10
SIN J2-10 SOUT J2-8
SCK J2-12 SCK J2-12
PCS0 J2-6 PCS1 J2-6
GND J2-14 GND J2-14
Prepare the Demo
Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.
Open a serial terminal on PC for MCU-Link serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPSPI board to board functional interrupt example.
Slave start to receive data...
LPSPI transfer all data matched!
Slave received:
0 1 2 3 4 5 6 7 8 9 A B C D E F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
End of slave example!
FRDM-MCXE247
Hardware requirements
USB-C cable
Two FRDM-MCXE247 boards
Personal Computer
Board settings
SPI two boards: Transfer data from one board instance to another board’s instance. SPI0 pins are connected with SPI0 pins of another board
INSTANCE0(SPI0) CONNECTS TO INSTANCE0(SPI0)
Pin Name Board Location Pin Name Board Location
SOUT J6 pin 6 SIN J6 pin 5
SIN J6 pin 5 SOUT J6 pin 6
SCK J6 pin 4 SCK J6 pin 4
PCS2 J6 pin 3 PCS2 J6 pin 3
GND J6 pin 8 GND J6 pin 8
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
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
Download the program to the target board.
Reset the SoC and run the project.
FRDM-MCXN236
Hardware requirements
Type-C USB cable
FRDM-MCXN236 board
Personal Computer
Board settings
To make the example work, connections needed to be as follows: Note: Jumper setting:
MASTER connect to SLAVE
Pin Name Board Location Pin Name Board Location
SOUT J2 - 8 SIN J2 - 10
SIN J2 - 10 SOUT J2 - 8
SCK J2 - 12 SCK J2 - 12
PCS0 J2 - 6 PCS0 J2 - 6
GND J2 - 14 GND J2 - 14
Other jumpers keep default configuration.
Prepare the Demo
Connect a mini USB cable between the PC host and the MCU-Link USB port on the board.
Open a serial terminal on PC for MCU-Link serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
FRDM-MCXN947
Hardware requirements
Type-C USB cable
FRDM-MCXN947 board
Personal Computer
Board settings
To make the example work, connections needed to be as follows: Note: Jumper setting:
MASTER connect to SLAVE
Pin Name Board Location Pin Name Board Location
SOUT J2 - 8 SIN J2 - 10
SIN J2 - 10 SOUT J2 - 8
SCK J2 - 12 SCK J2 - 12
PCS0 J2 - 6 PCS0 J2 - 6
GND J2 - 14 GND J2 - 14
Other jumpers keep default configuration.
Prepare the Demo
Connect a mini USB cable between the PC host and the MCU-Link USB port on the board.
Open a serial terminal on PC for MCU-Link serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
FRDM-MCXN947T
Hardware requirements
Type-C USB cable
FRDM-MCXN947T board
Personal Computer
Board settings
To make the example work, connections needed to be as follows: Note: Jumper setting:
MASTER connect to SLAVE
Pin Name Board Location Pin Name Board Location
SOUT J2 - 8 SIN J2 - 10
SIN J2 - 10 SOUT J2 - 8
SCK J2 - 12 SCK J2 - 12
PCS0 J2 - 6 PCS0 J2 - 6
GND J2 - 14 GND J2 - 14
Other jumpers keep default configuration.
Prepare the Demo
Connect a mini USB cable between the PC host and the MCU-Link USB port on the board.
Open a serial terminal on PC for MCU-Link serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
FRDM-MCXW71
Hardware requirements
Type-C USB cable
FRDM-MCXW71 Board
Personal Computer
Board settings
To make the example work, connections needed to be as follows: Note: Be sure to disconnect the 12V adapter on J9, otherwise the transmission will fail. Jumper setting:
MASTER(SPI0) connect to SLAVE(SPI0)
Pin Name Board Location Pin Name Board Location
SOUT J2 pin 9 SIN J1 pin 2
SIN J1 pin 2 SOUT J2 pin 9
SCK J1 pin 5 SCK J1 pin 5
PCS0 J1 pin 1 PCS0 J1 pin 1
Other jumpers keep default configuration.
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
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
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
MCX-W71-EVK
Hardware requirements
Type-C USB cable
MCX-W71-EVK Board
Personal Computer
Board settings
To make the example work, connections needed to be as follows: Jumper setting:
MASTER(SPI1) connect to SLAVE(SPI1)
Pin Name Board Location Pin Name Board Location
SOUT J2 pin 13 SIN J2 pin 11
SIN J2 pin 11 SOUT J2 pin 13
SCK J2 pin 9 SCK J2 pin 9
PCS0 J2 pin 15 PCS0 J2 pin 15
Other jumpers keep default configuration.
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
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
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
FRDM-MCXW72
Hardware requirements
Type-C USB cable
RDM-MCXW72 Board
Personal Computer
Board settings
To make the example work, connections needed to be as follows: Note: Be sure to disconnect the 12V adapter on J9, otherwise the transmission will fail. Jumper setting:
MASTER(SPI1) connect to SLAVE(SPI1)
Pin Name Board Location Pin Name Board Location
SOUT J2 pin 7 SIN J2 pin 6
SIN J2 pin 6 SOUT J2 pin 7
SCK J2 pin 5 SCK J2 pin 5
PCS0 J2 pin 8 PCS0 J2 pin 8
GND J2 pin 4 GND J2 pin 4
Other jumpers keep default configuration.
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
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
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPSPI interrupt board to board (b2b) slave example.
Slave start to receive data...
LPSPI transfer all data matched!
Slave received:
0 1 2 3 4 5 6 7 8 9 A B C D E F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
End of slave example!
KW45B41Z-EVK
Hardware requirements
Mini/micro USB cable
KW45B41Z-EVK Board
Personal Computer
Board settings
To make the example work, connections needed to be as follows: Note: Be sure to disconnect the 12V adapter on J9, otherwise the transmission will fail. Jumper setting:
MASTER(SPI0) connect to SLAVE(SPI0)
Pin Name Board Location Pin Name Board Location
SOUT J2 pin 2 SIN J1 pin 2
SIN J1 pin 2 SOUT J2 pin 2
SCK J1 pin 5 SCK J1 pin 5
PCS0 J1 pin 1 PCS0 J1 pin 1
Other jumpers keep default configuration.
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
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
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
KW47-EVK
Hardware requirements
Type-C USB cable
KW47-EVK Board
Personal Computer
Board settings
To make the example work, connections needed to be as follows: Note: Be sure to disconnect the 12V adapter on J9, otherwise the transmission will fail. Jumper setting:
MASTER(SPI1) connect to SLAVE(SPI1)
Pin Name Board Location Pin Name Board Location
SOUT J2 pin 13 SIN J2 pin 11
SIN J2 pin 11 SOUT J2 pin 13
SCK J2 pin 9 SCK J2 pin 9
PCS0 J2 pin 15 PCS0 J2 pin 15
Other jumpers keep default configuration.
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
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
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
MCIMX93AUTO-EVK
Hardware requirements
USB Type-C cable
two MCIMX93AUTO-EVK boards
J-Link Debug Probe
12V~20V power supply
Personal Computer
Board settings
Transfer data from one board instance to another board’s instance. SPI3 pins are connected with SPI3 pins of another board
INSTANCE0(SPI3) CONNECTS TO INSTANCE0(SPI3)
Pin Name Board Location Pin Name Board Location
SPI3_SCK J16 pin 23 SPI3_SCK J16 pin 23
SPI3_SIN J16 pin 21 SPI3_SOUT J16 pin 19
SPI3_SOUT J16 pin 19 SPI3_SIN J16 pin 21
SPI3_PCS0 J16 pin 24 SPI3_PCS0 J16 pin 24
GND GND
Note
Please run the application in Low Power boot mode (without Linux BSP). The IP module resource of the application is also used by Linux BSP. Or, run with Single Boot mode by changing Linux BSP to avoid resource conflict.
Prepare the Demo
Connect 12V~20V power supply and J-Link Debug Probe to the board, switch SW2 to power on the board.
Connect a USB Type-C cable between the host PC and the J26 USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either cold boot your board or launch the debugger in your IDE to begin running the example.
MCIMX93-EVK
Hardware requirements
USB Type-C cable
two MCIMX93-EVK boards
J-Link Debug Probe
12V~20V power supply
Personal Computer
Board settings
Transfer data from one board instance to another board’s instance. SPI3 pins are connected with SPI3 pins of another board
INSTANCE0(SPI3) CONNECTS TO INSTANCE0(SPI3)
Pin Name Board Location Pin Name Board Location
SPI3_SCK J1001 pin 23 SPI3_SCK J1001 pin 23
SPI3_SIN J1001 pin 21 SPI3_SOUT J1001 pin 19
SPI3_SOUT J1001 pin 19 SPI3_SIN J1001 pin 21
SPI3_PCS0 J1001 pin 24 SPI3_PCS0 J1001 pin 24
GND GND
Note
Please run the application in Low Power boot mode (without Linux BSP). The IP module resource of the application is also used by Linux BSP. Or, run with Single Boot mode by changing Linux BSP to avoid resource conflict.
Prepare the Demo
Connect 12V~20V power supply and J-Link Debug Probe to the board, switch SW301 to power on the board.
Connect a USB Type-C cable between the host PC and the J1401 USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either cold boot your board or launch the debugger in your IDE to begin running the example.
MCIMX93W-EVK
Hardware requirements
USB Type-C cable
two MCIMX93W-EVK boards
J-Link Debug Probe
12V~20V power supply
Personal Computer
Board settings
Transfer data from one board instance to another board’s instance. SPI3 pins are connected with SPI3 pins of another board
INSTANCE0(SPI3) CONNECTS TO INSTANCE0(SPI3)
Pin Name Board Location Pin Name Board Location
SPI3_SCK J1001 pin 23 SPI3_SCK J1001 pin 23
SPI3_SIN J1001 pin 21 SPI3_SOUT J1001 pin 19
SPI3_SOUT J1001 pin 19 SPI3_SIN J1001 pin 21
SPI3_PCS0 J1001 pin 24 SPI3_PCS0 J1001 pin 24
GND GND
Note
Please run the application in Low Power boot mode (without Linux BSP). The IP module resource of the application is also used by Linux BSP. Or, run with Single Boot mode by changing Linux BSP to avoid resource conflict.
Prepare the Demo
Connect 12V~20V power supply and J-Link Debug Probe to the board, switch SW301 to power on the board.
Connect a USB Type-C cable between the host PC and the J1401 USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either cold boot your board or launch the debugger in your IDE to begin running the example.
MCIMX93-QSB
Hardware requirements
USB Type-C cable
two MCIMX93-QSB boards
J-Link Debug Probe
12V~20V power supply
Personal Computer
Board settings
Transfer data from one board instance to another board’s instance. SPI3 pins are connected with SPI3 pins of another board
INSTANCE0(SPI3) CONNECTS TO INSTANCE0(SPI3)
Pin Name Board Location Pin Name Board Location
SPI3_SCK J1401 pin 23 SPI3_SCK J1401 pin 23
SPI3_SIN J1401 pin 21 SPI3_SOUT J1401 pin 19
SPI3_SOUT J1401 pin 19 SPI3_SIN J1401 pin 21
SPI3_PCS0 J1401 pin 24 SPI3_PCS0 J1401 pin 24
GND GND
Note
Please run the application in Low Power boot mode (without Linux BSP). The IP module resource of the application is also used by Linux BSP. Or, run with Single Boot mode by changing Linux BSP to avoid resource conflict.
Prepare the Demo
Connect 12V~20V power supply and J-Link Debug Probe to the board, switch SW301 to power on the board.
Connect a USB Type-C cable between the host PC and the J1708 USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either cold boot your board or launch the debugger in your IDE to begin running the example.
MCX-N5XX-EVK
Hardware requirements
Mini/micro USB cable
MCX-N5xx-EVK board
Personal Computer
Board settings
To make the example work, connections needed to be as follows: Note: Jumper setting:
MASTER connect to SLAVE
Pin Name Board Location Pin Name Board Location
SOUT J2 - 8 SIN J2 - 10
SIN J2 - 10 SOUT J2 - 8
SCK J2 - 12 SCK J2 - 12
PCS0 J2 - 6 PCS0 J2 - 6
GND J2 - 14 GND J2 - 14
Other jumpers keep default configuration.
Prepare the Demo
Connect a mini USB cable between the PC host and the MCU-Link USB port on the board.
Open a serial terminal on PC for MCU-Link serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
MCX-N9XX-EVK
Hardware requirements
Mini/micro USB cable
MCX-N9xx-EVK board
Personal Computer
Board settings
To make the example work, connections needed to be as follows: Note: Jumper setting:
MASTER connect to SLAVE
Pin Name Board Location Pin Name Board Location
SOUT J2 - 8 SIN J2 - 10
SIN J2 - 10 SOUT J2 - 8
SCK J2 - 12 SCK J2 - 12
PCS0 J2 - 6 PCS0 J2 - 6
GND J2 - 14 GND J2 - 14
Other jumpers keep default configuration.
Prepare the Demo
Connect a mini USB cable between the PC host and the MCU-Link USB port on the board.
Open a serial terminal on PC for MCU-Link serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
MCX-W72-EVK
Hardware requirements
Type-C USB cable
MCX-W72-EVK Board
Personal Computer
Board settings
To make the example work, connections needed to be as follows: Note: Be sure to disconnect the 12V adapter on J9, otherwise the transmission will fail. Jumper setting:
MASTER(SPI1) connect to SLAVE(SPI1)
Pin Name Board Location Pin Name Board Location
SOUT J2 pin 13 SIN J2 pin 11
SIN J2 pin 11 SOUT J2 pin 13
SCK J2 pin 9 SCK J2 pin 9
PCS0 J2 pin 15 PCS0 J2 pin 15
Other jumpers keep default configuration.
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
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
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
FRDM-MCXE31B
Hardware requirements
Type-C USB cable
FRDM-MCXE31B board
Personal Computer
Board settings
LPSPI:
INSTANCE1(LPSPI_1) CONNECTS TO INSTANCE1(LPSPI_1)
Pin Name Board Location Pin Name Board Location
SOUT J6 pin 6 SIN J6 pin 5
SIN J6 pin 5 SOUT J6 pin 6
SCK J6 pin 4 SCK J6 pin 4
PCS0 J6 pin 3 PCS0 J6 pin 3
GND J6 pin 8 GND J6 pin 8
Prepare the Demo
Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.
Open a serial terminal on PC for MCU-Link serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
FRDM-MCXE32B
Hardware requirements
Type-C USB cable
FRDM-MCXE32B board
Personal Computer
Board settings
LPSPI:
INSTANCE1(LPSPI_1) CONNECTS TO INSTANCE1(LPSPI_1)
Pin Name Board Location Pin Name Board Location
SOUT J6 pin 6 SIN J6 pin 5
SIN J6 pin 5 SOUT J6 pin 6
SCK J6 pin 4 SCK J6 pin 4
PCS0 J6 pin 3 PCS0 J6 pin 3
GND J6 pin 8 GND J6 pin 8
Prepare the Demo
Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.
Open a serial terminal on PC for MCU-Link serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
FRDM-MCXL255
Hardware requirements
Type-C USB cable
FRDM-MCXL255 board
Personal Computer
Board settings
LPSPI:
MASTER(SPI1) connect to SLAVE(SPI1)
Pin Name Board Location Pin Name Board Location
SOUT J2-8 SIN J2-10
SIN J2-10 SOUT J2-8
SCK J2-12 SCK J2-12
PCS0 J2-6 PCS1 J2-6
GND J2-14 GND J2-14
Make sure you have solder bridges SJ1 and SJ2 set to
2-1 for the main core (cm33)
Prepare the Demo
Connect a USB Type-C cable between the host PC and the MCU-Link USB port (J16) on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPSPI board to board functional interrupt example.
Slave start to receive data...
LPSPI transfer all data matched!
Slave received:
0 1 2 3 4 5 6 7 8 9 A B C D E F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
End of slave example!
FRDM-MCXA174
Overview
The lpspi_interrupt_b2b example shows how to use LPSPI driver in interrupt way:
In this example , we need two boards , one board used as LPSPI master and another board used as LPSPI slave. The file ‘dspi_interrupt_b2b_slave.c’ includes the LPSPI slave code. This example does not use the transactional API in LPSPI driver. It’s a demonstration that how to use the interrupt in KSDK driver.
LPSPI master send/received data to/from LPSPI slave in interrupt . (LPSPI Slave using interrupt to receive/send the data)
Hardware requirements
Type-C USB cable
FRDM-MCXA174 board
Personal Computer
Board settings
LPSPI:
MASTER(SPI1) connect to SLAVE(SPI1)
Pin Name Board Location Pin Name Board Location
SOUT J2-8 SIN J2-10
SIN J2-10 SOUT J2-8
SCK J2-12 SCK J2-12
PCS0 J2-6 PCS1 J2-6
GND J2-14 GND J2-14
Prepare the Demo
Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.
Open a serial terminal on PC for MCU-Link serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPSPI board to board functional interrupt example.
Slave start to receive data...
LPSPI transfer all data matched!
Slave received:
0 1 2 3 4 5 6 7 8 9 A B C D E F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
End of slave example!
FRDM-MCXA344
Overview
The lpspi_interrupt_b2b example shows how to use LPSPI driver in interrupt way:
In this example , we need two boards , one board used as LPSPI master and another board used as LPSPI slave. The file ‘dspi_interrupt_b2b_slave.c’ includes the LPSPI slave code. This example does not use the transactional API in LPSPI driver. It’s a demonstration that how to use the interrupt in KSDK driver.
LPSPI master send/received data to/from LPSPI slave in interrupt . (LPSPI Slave using interrupt to receive/send the data)
Hardware requirements
Type-C USB cable
FRDM-MCXA344 board
Personal Computer
Board settings
LPSPI:
MASTER(SPI1) connect to SLAVE(SPI1)
Pin Name Board Location Pin Name Board Location
SOUT J2-8 SIN J2-10
SIN J2-10 SOUT J2-8
SCK J2-12 SCK J2-12
PCS0 J2-6 PCS1 J2-6
GND J2-14 GND J2-14
Prepare the Demo
Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.
Open a serial terminal on PC for MCU-Link serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPSPI board to board functional interrupt example.
Slave start to receive data...
LPSPI transfer all data matched!
Slave received:
0 1 2 3 4 5 6 7 8 9 A B C D E F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
End of slave example!
KW47-LOC
Hardware requirements
Type-C USB cable
KW47-LOC Board
Personal Computer
Board settings
To make the example work, connections needed to be as follows: Note: Be sure to disconnect the 12V adapter on J9, otherwise the transmission will fail. Jumper setting:
MASTER(SPI1) connect to SLAVE(SPI1)
Pin Name Board Location Pin Name Board Location
SOUT J1 pin 6 SIN J1 pin 5
SIN J1 pin 5 SOUT J1 pin 6
SCK J1 pin 4 SCK J1 pin 4
PCS0 J1 pin 3 PCS0 J1 pin 3
Other jumpers keep default configuration.
Prepare the Demo
Connect a USB cable between the PC host and the OpenSDA USB port on the board.
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
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
MCXW72-LOC
Hardware requirements
Type-C USB cable
MCXW72-LOC Board
Personal Computer
Board settings
To make the example work, connections needed to be as follows: Note: Be sure to disconnect the 12V adapter on J9, otherwise the transmission will fail. Jumper setting:
MASTER(SPI1) connect to SLAVE(SPI1)
Pin Name Board Location Pin Name Board Location
SOUT J1 pin 6 SIN J1 pin 5
SIN J1 pin 5 SOUT J1 pin 6
SCK J1 pin 4 SCK J1 pin 4
PCS0 J1 pin 3 PCS0 J1 pin 3
Other jumpers keep default configuration.
Prepare the Demo
Connect a USB cable between the PC host and the OpenSDA USB port on the board.
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
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
FRDM-IMXRT1186
Hardware requirements
Type-C USB cable
FRDM-IMXRT1186 board
Personal Computer
Board settings
SPI two boards: Transfer data from one board instance to another board’s instance. SPI2 pins are connected with SPI2 pins of another board
INSTANCE(LPSPI2) CONNECTS TO INSTANCE(LPSPI2)
Pin Name Board Location Pin Name Board Location
SOUT J3-16 SIN J3-14
SIN J3-14 SOUT J3-16
SCK J3-18 SCK J3-18
PCS0 J3-12 PCS0 J3-12
GND J2-19 GND J2-19
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
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
Download the program to the target board.
Reset the SoC and run the project.
FRDM-MCXA266
Overview
The lpspi_interrupt_b2b example shows how to use LPSPI driver in interrupt way:
In this example , we need two boards , one board used as LPSPI master and another board used as LPSPI slave. The file ‘dspi_interrupt_b2b_slave.c’ includes the LPSPI slave code. This example does not use the transactional API in LPSPI driver. It’s a demonstration that how to use the interrupt in KSDK driver.
LPSPI master send/received data to/from LPSPI slave in interrupt . (LPSPI Slave using interrupt to receive/send the data)
Hardware requirements
Type-C USB cable
FRDM-MCXA266 board
Personal Computer
Board settings
LPSPI:
MASTER(SPI1) connect to SLAVE(SPI1)
Pin Name Board Location Pin Name Board Location
SOUT J2-8 SIN J2-10
SIN J2-10 SOUT J2-8
SCK J2-12 SCK J2-12
PCS0 J2-6 PCS1 J2-6
GND J2-14 GND J2-14
Prepare the Demo
Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.
Open a serial terminal on PC for MCU-Link serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPSPI board to board functional interrupt example.
Slave start to receive data...
LPSPI transfer all data matched!
Slave received:
0 1 2 3 4 5 6 7 8 9 A B C D E F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
End of slave example!
FRDM-MCXA366
Overview
The lpspi_interrupt_b2b example shows how to use LPSPI driver in interrupt way:
In this example , we need two boards , one board used as LPSPI master and another board used as LPSPI slave. The file ‘dspi_interrupt_b2b_slave.c’ includes the LPSPI slave code. This example does not use the transactional API in LPSPI driver. It’s a demonstration that how to use the interrupt in KSDK driver.
LPSPI master send/received data to/from LPSPI slave in interrupt . (LPSPI Slave using interrupt to receive/send the data)
Hardware requirements
Type-C USB cable
FRDM-MCXA366 board
Personal Computer
Board settings
LPSPI:
MASTER(SPI1) connect to SLAVE(SPI1)
Pin Name Board Location Pin Name Board Location
SOUT J2-8 SIN J2-10
SIN J2-10 SOUT J2-8
SCK J2-12 SCK J2-12
PCS0 J2-6 PCS1 J2-6
GND J2-14 GND J2-14
Prepare the Demo
Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.
Open a serial terminal on PC for MCU-Link serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPSPI board to board functional interrupt example.
Slave start to receive data...
LPSPI transfer all data matched!
Slave received:
0 1 2 3 4 5 6 7 8 9 A B C D E F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
End of slave example!
FRDM-MCXA577
Overview
The lpspi_interrupt_b2b example shows how to use LPSPI driver in interrupt way:
In this example , we need two boards , one board used as LPSPI master and another board used as LPSPI slave. The file ‘dspi_interrupt_b2b_slave.c’ includes the LPSPI slave code. This example does not use the transactional API in LPSPI driver. It’s a demonstration that how to use the interrupt in KSDK driver.
LPSPI master send/received data to/from LPSPI slave in interrupt . (LPSPI Slave using interrupt to receive/send the data)
Hardware requirements
Type-C USB cable
FRDM-MCXA577 board
Personal Computer
Board settings
LPSPI:
MASTER(SPI1) connect to SLAVE(SPI1)
Pin Name Board Location Pin Name Board Location
SOUT J2-8 SIN J2-10
SIN J2-10 SOUT J2-8
SCK J2-12 SCK J2-12
PCS0 J2-6 PCS1 J2-6
GND J2-14 GND J2-14
Prepare the Demo
Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.
Open a serial terminal on PC for MCU-Link serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPSPI board to board functional interrupt example.
Slave start to receive data...
LPSPI transfer all data matched!
Slave received:
0 1 2 3 4 5 6 7 8 9 A B C D E F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
End of slave example!
FRDM-MCXC162
Overview
The lpspi_interrupt_b2b example shows how to use LPSPI driver in interrupt way:
In this example , we need two boards , one board used as LPSPI master and another board used as LPSPI slave. The file ‘dspi_interrupt_b2b_slave.c’ includes the LPSPI slave code. This example does not use the transactional API in LPSPI driver. It’s a demonstration that how to use the interrupt in KSDK driver.
LPSPI master send/received data to/from LPSPI slave in interrupt . (LPSPI Slave using interrupt to receive/send the data)
Hardware requirements
Type-C USB cable
FRDM-MCXC162 board
Personal Computer
Board settings
LPSPI:
MASTER(SPI0) connect to SLAVE(SPI0)
Pin Name Board Location Pin Name Board Location
SOUT J2-8 SIN J2-10
SIN J2-10 SOUT J2-8
SCK J2-12 SCK J2-12
PCS0 J2-6 PCS1 J2-6
GND J2-14 GND J2-14
Prepare the Demo
Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.
Open a serial terminal on PC for MCU-Link serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPSPI board to board functional interrupt example.
Slave start to receive data...
LPSPI transfer all data matched!
Slave received:
0 1 2 3 4 5 6 7 8 9 A B C D E F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
End of slave example!
FRDM-KW43
Hardware requirements
Type-C USB cable
FRDM-KW43 Board
Personal Computer
Board settings
To make the example work, connections needed to be as follows: Jumper setting:
MASTER(SPI1) connect to SLAVE(SPI1)
Pin Name Board Location Pin Name Board Location
SOUT J19 pin 5 SIN J19 pin 4
SIN J19 pin 4 SOUT J19 pin 5
SCK J19 pin 6 SCK J19 pin 6
PCS0 J19 pin 3 PCS0 J19 pin 3
Other jumpers keep default configuration.
Prepare the Demo
Connect a Type-C USB cable between the PC host and the OpenSDA USB port on the board.
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
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
FRDM-MCXW70
Hardware requirements
Type-C USB cable
FRDM-MCXW70 Board
Personal Computer
Board settings
To make the example work, connections needed to be as follows: Jumper setting:
MASTER(SPI1) connect to SLAVE(SPI1)
Pin Name Board Location Pin Name Board Location
SOUT J19 pin 5 SIN J19 pin 4
SIN J19 pin 4 SOUT J19 pin 5
SCK J19 pin 6 SCK J19 pin 6
PCS0 J19 pin 3 PCS0 J19 pin 3
Other jumpers keep default configuration.
Prepare the Demo
Connect a Type-C USB cable between the PC host and the OpenSDA USB port on the board.
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
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
FRDM-MCXA287
Overview
The lpspi_interrupt_b2b example shows how to use LPSPI driver in interrupt way:
In this example , we need two boards , one board used as LPSPI master and another board used as LPSPI slave. The file ‘dspi_interrupt_b2b_slave.c’ includes the LPSPI slave code. This example does not use the transactional API in LPSPI driver. It’s a demonstration that how to use the interrupt in KSDK driver.
LPSPI master send/received data to/from LPSPI slave in interrupt . (LPSPI Slave using interrupt to receive/send the data)
Hardware requirements
Type-C USB cable
FRDM-MCXA287 board
Personal Computer
Board settings
LPSPI:
MASTER(SPI1) connect to SLAVE(SPI1)
Pin Name Board Location Pin Name Board Location
SOUT J2-8 SIN J2-10
SIN J2-10 SOUT J2-8
SCK J2-12 SCK J2-12
PCS0 J2-6 PCS1 J2-6
GND J2-14 GND J2-14
Prepare the Demo
Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.
Open a serial terminal on PC for MCU-Link serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPSPI board to board functional interrupt example.
Slave start to receive data...
LPSPI transfer all data matched!
Slave received:
0 1 2 3 4 5 6 7 8 9 A B C D E F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
End of slave example!
frdmimx952
Hardware requirements
Micro USB cable
two IMX952-EVK boards
J-Link Debug Probe
12V~20V power supply
Personal Computer
Board settings
Connection as below:
MASTER(LPSPI7) connect to SLAVE(LPSPI7)
Pin Name Board Location Pin Name Board Location
PCS0 J18 pin 7 PCS0 J18 pin 7
SCK J18 pin 26 SCK J18 pin 26
SOUT J18 pin 31 SIN J18 pin 9
SIN J18 pin 9 SOUT J18 pin 31
GND J18 pin 6 GND J18 pin 6
IMPORTANT: SOUT/SIN (MOSI/MISO) lines MUST be crossed as shown above.
Note: J18 is the 40-PIN GPIO HDR expansion connector. - J18-Pin7: LPSPI7_PCS0 (GPIO_IO04) - Chip Select - J18-Pin26: LPSPI7_SCK (GPIO_IO07) - Clock - J18-Pin31: LPSPI7_SOUT (GPIO_IO06) - MOSI (connects to slave SIN) - J18-Pin9: LPSPI7_SIN (GPIO_IO05) - MISO (connects to slave SOUT) - J18-Pin6: Common Ground (any GND pin on J18 can be used) - Each board must be powered independently - No IO expander configuration required for this example
Prepare the Demo
Connect 12V~20V power supply and J-Link Debug Probe to the board, switch SW4 to power on the board.
Connect a micro USB cable between the host PC and the J31 USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either cold boot your board or launch the debugger in your IDE to begin running the example.
Running the demo
When the demo runs successfully, the log would be seen on the terminal like:
LPSPI board to board functional interrupt example.
Slave start to receive data...
LPSPI transfer all data matched!
Slave received:
0 1 2 3 4 5 6 7 8 9 A B C D E F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
End of slave example!
FRDM-IMX95
Hardware requirements
Micro USB cable
one FRDM-IMX95 board and MCIMX93EVK board
J-Link Debug Probe
12V~20V power supply
Personal Computer
Board settings
Transfer data from one board instance to another board’s instance. SPI3 pins are connected with SPI3 pins of another board
INSTANCE0(SPI3) CONNECTS TO INSTANCE0(SPI3)
Pin Name Board Location Pin Name Board Location
SPI3_SCK FRDMIMX95 J19 pin 23 SPI3_SCK FRDMIMX95 J19 pin 23
SPI3_SIN FRDMIMX95 J19 pin 21 SPI3_SOUT FRDMIMX95 J19 pin 19
SPI3_SOUT FRDMIMX95 J19 pin 19 SPI3_SIN FRDMIMX95 J19 pin 21
SPI3_PCS0 FRDMIMX95 J19 pin 24 SPI3_PCS0 FRDMIMX95 J19 pin 24
GND GND
Prepare the Demo
Connect 12V~20V power supply and J-Link Debug Probe to the board, switch SW4 to power on the board.
Connect a micro USB cable between the host PC and the J31 USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either cold boot your board or launch the debugger in your IDE to begin running the example.
Running the demo
When the demo runs successfully, the log would be seen on the terminal like:
LPSPI board to board functional interrupt example.
Slave start to receive data...
LPSPI transfer all data matched!
Slave received:
0 1 2 3 4 5 6 7 8 9 A B C D E F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
End of slave example!