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

Adafruit_BBIO SPI 32 bits per word
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Adafruit_BBIO SPI 32 bits per word

by acheesehead on Wed Jul 13, 2016 11:29 am

Why is the SPI bits per word limited to 16? Looking at the TRM, 32 bpw is supported by the AM335x (MCSPI_CH0CONF bits 11..7 = 0x1f). I have a DAC module that uses a 32 bit word. If I simply modify spimodule.c at line 618 from

if (bits < 8 || bits > 16) {

to

if (bits < 8 || bits > 32) {

Will it simply work?

acheesehead
 
Posts: 1
Joined: Wed Jul 13, 2016 11:22 am

Re: Adafruit_BBIO SPI 32 bits per word

by drewfustini on Wed Jul 20, 2016 4:23 am

There is another Python library for BeagleBone called PyBBIO. This GitHub issue does state that 32 bits does work:
https://github.com/graycatlabs/serbus/i ... -162068810
Yes, this was on the Beaglebone Black. edit: just for kicks I ran through a bunch of values:

Working - 4, 5, 6, 7, 8, 12, 13, 14, 15, 16, 32
Broke - 9,10,11,17, 18, 24


PyBBIO is using the serbus library which doesn't place any restriction on word size:
https://github.com/graycatlabs/serbus/b ... pidriver.c

Ultimately, it is the spi-omap2-mcspi.c driver in the Linux kernel that actually interfaces with the AM3358's McSPI peripherial:
http://lxr.free-electrons.com/source/dr ... p2-mcspi.c

So I would say try out modifying spimodule.c and please report your results.

Also, I can try it out myself if you can post your code here.

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

Please be positive and constructive with your questions and comments.