Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:general_information:tutorial:spi [2015/08/17 11:00] liedmannen:general_information:tutorial:spi [2022/08/04 15:02] (current) – external edit 127.0.0.1
Line 1: Line 1:
-===== CAN =====+~~NOCACHE~~ 
 +~~NOTOC~~ 
 +===== SPI =====
 \\ \\
-<WRAP round important 45%>Tested on STKa6x BSP Rev.0104 and BSP Rev.0105</WRAP>+<WRAP round important 55%>This tutorial was tested on STKa6x BSP with Rev.0104 and BSP Rev.0105</WRAP>
  
-SPI can be tested on the starterkit with **spidev_test** from the kernel sources\\ +SPI can be tested with **spidev_test** from the kernel sources.\\  
-[[http://https://www.kernel.org/doc/Documentation/spi/spidev_test.c]]\\ +[[https://www.kernel.org/doc/Documentation/spi/spidev_test.c]]\\ 
- **spidev_test** is included in the sd image by default.+**spidev_test** is included by default in the BSP, you will find it under **/usr/bin/**. 
 +\\ 
 +==== Testing spidev 0.1 ==== 
 + 
 +<wrap Round info 65%>spidev_test is a loopback test, to use it on the Starterkit put a bridge between the pins **X27_43 (SPI1.MOSI)** and **X27_44 (SPI1.MISO)**.</wrap> 
 + 
 +To run spidev with /dev/spi0.1 you need to specify the device with -D parameter 
 +<code> 
 +root@MBa6x:cd /usr/bin 
 +root@MBa6x:/usr/bin ./spidev_test -D /dev/spidev0.1 
 +</code> 
 + 
 + 
 +++++console output with open bridge:|  
 +<code> 
 +root@MBa6x:/usr/bin ./spidev_test -D /dev/spidev0.1 
 +spi mode: 0 
 +bits per word: 8 
 +max speed: 500000 Hz (500 KHz)
  
-To run the SPI loopback test please put a bridge between **X27_43(SPI1.MOSI)** and **X27_44(SPI1.MISO)** on the starterkit.\\+FF FF FF FF FF FF 
 +FF FF FF FF FF FF 
 +FF FF FF FF FF FF 
 +FF FF FF FF FF FF 
 +FF FF FF FF FF FF 
 +FF FF FF FF FF FF 
 +FF FF  
 +</code> 
 +++++ 
 +++++ console output with closed bridge:|  
 +<code> 
 +root@MBa6x:/usr/bin ./spidev_test -D /dev/spidev0.1 
 +spi mode: 0 
 +bits per word: 8 
 +max speed: 500000 Hz (500 KHz)
  
 +FF FF FF FF FF FF
 +40 00 00 00 00 95
 +FF FF FF FF FF FF
 +FF FF FF FF FF FF
 +FF FF FF FF FF FF
 +DE AD BE EF BA AD
 +F0 0D
 +</code>
 +++++
 +==== Testing spidev 4.0 ====
  
 +<wrap Round info 65%>spidev_test is a loopback test, to use it on the starterkit put a bridge between the pins **X28_51 (ECSPI5.MIS0)** and **X28_53 (ECSPI5.MOSI)**.</wrap>
  
- +To run spidev with /dev/spi4.0 you need to specify the device with -D parameter  
 +<code> 
 +root@MBa6x:cd /usr/bin 
 +root@MBa6x:/usr/bin ./spidev_test -D /dev/spidev4.0 
 +</code> 
 +++++console output with open bridge:|  
 +<code> 
 +root@MBa6x:/usr/bin ./spidev_test -D /dev/spidev4.0 
 +spi mode: 0 
 +bits per word: 8 
 +max speed: 500000 Hz (500 KHz)
  
 +FF FF FF FF FF FF
 +FF FF FF FF FF FF
 +FF FF FF FF FF FF
 +FF FF FF FF FF FF
 +FF FF FF FF FF FF
 +FF FF FF FF FF FF
 +FF FF 
 +</code>
 +++++
 +++++ console output with closed bridge:
 +<code>
 +root@MBa6x:/usr/bin ./spidev_test -D /dev/spidev4.0
 +spi mode: 0
 +bits per word: 8
 +max speed: 500000 Hz (500 KHz)
  
 +FF FF FF FF FF FF
 +40 00 00 00 00 95
 +FF FF FF FF FF FF
 +FF FF FF FF FF FF
 +FF FF FF FF FF FF
 +DE AD BE EF BA AD
 +F0 0D
 +</code>
 +++++
  • Last modified: 2022/08/04 15:04