I am trying to configure SPI0 on the beagle bone black. I am using Adafruit library. BB is connected to a FPGA which has a slave device.
When I run the following code snippet after configure the pins to spi, I always get 255 an my slave device is not receiving any data.
The following is configurations:
config-pin p9_17 spi_cs
config-pin p9_18 spi
config-pin p9_21 spi
config-pin p9_22 spi_sclk
the following is the code I am using:
def Read_spi_address(bus, device):
from Adafruit_BBIO.SPI import SPI
import Adafruit_BBIO.GPIO as GPIO
spi_dev = SPI(bus, device) print("testing SPI\n") # configure SPI spi_dev.msh = 5000000 spi_dev.bpw = 8 # data width of 8 bits spi_dev.lsbfirst = False spi_dev.mode = 0 spi_dev.cshigh = False spi_dev.threewire = False spi_dev.open(bus, device) print("spi speed is:" + str(spi_dev.msh)) print(spi_dev.xfer2([50, 60, 70, 80])) spi_dev.close()
Any help is appreciated.