|
||
---|---|---|
.. | ||
armgcc | ||
board_setup.c | ||
board_setup.h | ||
board.c | ||
board.h | ||
clock_config.c | ||
clock_config.h | ||
dcd.c | ||
dcd.h | ||
pin_mux.c | ||
pin_mux.h | ||
readme.md | ||
spi_b2b_example_master_v3_14.xml | ||
spi_b2b_example_master.c | ||
tx_lpspi_master.c | ||
tx_spi.h | ||
tx_user.h |
Overview
The spi_b2b_example_master example shows how to use LPSPI driver in Azure RTOS.
This example needs two boards, one is used as LPSPI master runnuing the spi_b2b_example_master example, and the other is used as LPSPI slave running the spi_b2b_example_slave example.
Start the spi_b2b_example_slave example first, then start the spi_b2b_example_master example.
SDK version
- Version: 2.15.000
Toolchain supported
- IAR embedded Workbench 9.40.1
- Keil MDK 5.38.1
- GCC ARM Embedded 12.2
- MCUXpresso 11.8.0
Hardware requirements
- Mini/micro USB cable
- EVKB-IMXRT1050 board
- Personal Computer
- 5-pin flat cable
Board settings
Weld 0Ω resistor to R278,R279,R280,R281.
SPI1 pins are connected with SPI1 pins of another board
BOARD1(LPSPI1) CONNECTS TO BOARD2(LPSPI1)
Pin Name Board Location Pin Name Board Location
PCS0 J24 pin 3 PCS0 J24 pin 3
SOUT J24 pin 4 SIN J24 pin 5
SIN J24 pin 5 SOUT J24 pin 4
SCK J24 pin 6 SCK J24 pin 6
GND J24 pin 7 GND J24 pin 7
Note that one board works as SPI master, and the other works as SPI slave.
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.
Running the demo
After starting the example, the serial port will output:
Start the SPI board-to-board master example
Master transmitted: 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f 0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f
Master received: 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f 0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f
Slave-to-master data verified ok.