Hello, im using beagleboneblack and i'm having some troubles with the SPI library.
Im trying to send a 16 bits word, but the maxium that it does is 8. Here is the code:
import Adafruit_BBIO.GPIO as GPIO
from Adafruit_BBIO.SPI import SPI
spi = SPI(0, 0)
spi.mode = 0
spi.bpw = 16
print(spi.xfer2([0b1111111111111111]))
spi.close()
my MOSI and MISO pins are shorted-circuited, so this code should return "65535", but it returns "255". Only the 8 last significant bits are considered.
Also, if i try to change the bpw for any other number (11, for example) the beaglebone stop and im forced to press the reset button.
Problems with ADAFRUIT_SPI
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- drewfustini
- Posts: 944
- Joined: Sat Dec 26, 2015 1:19 pm
Re: Problems with ADAFRUIT_SPI
It is important to see the output of this script to determine your BeagleBone is configured correctly.
Please run this command and paste the output in your reply:
sudo /opt/scripts/tools/version.sh
Please run this command and paste the output in your reply:
sudo /opt/scripts/tools/version.sh
- Davizz
- Posts: 2
- Joined: Tue Oct 09, 2018 2:51 pm
Re: Problems with ADAFRUIT_SPI
root@beaglebone:/var/lib/cloud9# sudo /opt/scripts/tools/version.sh
sudo: /opt/scripts/tools/version.sh: command not found
sudo: /opt/scripts/tools/version.sh: command not found
- drewfustini
- Posts: 944
- Joined: Sat Dec 26, 2015 1:19 pm
Re: Problems with ADAFRUIT_SPI
Hi, that is odd that /opt/scripts/tools/version.sh does not exist.
Could you please try running these commands and paste the output?
cat /etc/dogtag
cat /etc/version
uname -a
If you are able to, then I would recommend downloading the most recent BeagleBoard.org Debian Linux image:
Stretch IoT (without graphical desktop) for BeagleBone and PocketBeagle via microSD card
Debian 9.5 2018-10-07 4GB SD IoT
Could you please try running these commands and paste the output?
cat /etc/dogtag
cat /etc/version
uname -a
If you are able to, then I would recommend downloading the most recent BeagleBoard.org Debian Linux image:
Stretch IoT (without graphical desktop) for BeagleBone and PocketBeagle via microSD card
Debian 9.5 2018-10-07 4GB SD IoT
Please be positive and constructive with your questions and comments.