Adafruit Industries, Essential service and business: NYC – Executive Order 202.6 - Read more. Accepting essential orders - here's how.
0

Problems with ADAFRUIT_SPI
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Problems with ADAFRUIT_SPI

by Davizz on Tue Oct 09, 2018 2:58 pm

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.

Davizz
 
Posts: 2
Joined: Tue Oct 09, 2018 2:51 pm

Re: Problems with ADAFRUIT_SPI

by drewfustini on Fri Oct 12, 2018 6:35 am

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

drewfustini
 
Posts: 920
Joined: Sat Dec 26, 2015 1:19 pm

Re: Problems with ADAFRUIT_SPI

by Davizz on Mon Oct 15, 2018 7:34 am

root@beaglebone:/var/lib/cloud9# sudo /opt/scripts/tools/version.sh
sudo: /opt/scripts/tools/version.sh: command not found

Davizz
 
Posts: 2
Joined: Tue Oct 09, 2018 2:51 pm

Re: Problems with ADAFRUIT_SPI

by drewfustini on Tue Oct 16, 2018 11:22 am

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

drewfustini
 
Posts: 920
Joined: Sat Dec 26, 2015 1:19 pm

Please be positive and constructive with your questions and comments.