I am working on a design project involving a BeagleBone Black and an 
ADXL375 Accelerometer.

Per the data sheet (link below), in order to enable the maximum sampling 
rate of the ADXL375, I need my BBB to communicate with the ADXL375 over SPI 
(I2C is not fast enough for this).

I have used the Adafruit library for I2C just to test the functionality of 
the ADXL375, and I can confirm that the accel. does in fact work. However, 
I am unsure of how to even perform a simple read of the ADXL375 DEVID 
register using SPI. I have included my steps for how I think a read should 
be performed, but I suspect that this process is incorrect as I get no 
output.

Process for reading from SPI (from python terminal):

from Adafruit_BBIO.SPI import SPI

#using SPI bus 0 on P9 of BBB, assuming i'm using dev0, not really sure how 
to determine this, but I have no other peripherals connected
spi = SPI(0,0)

#set desired frequency, 2MHz
spi.msh = 2000000

#per the ADXL375 datasheet, when performing a read, need to send a byte 
where bits 0-5 are address bits (DEVID register is 0x0), bit 6 is a 
multiple bytes bit (for reading/writing multiple bytes), and bit 7 is a 
read/write bit where read is '1' and write is '0'

#so I use 0b10000000 or 0x80 and call writebytes
spi.writebytes([0x80])

>From here I receive no output, even if I do spi.readbytes(1), I get [0] 
back.

I have a pretty good understanding of Linux, Python, C, and the concept of 
SPI seems simple enough, but this is my first experience with a BBB and 
SPI. I feel like I am missing something simple like setting CS low.

Here is some info about my BBB:
lsb_release -a
Distributor ID: Angstrom
Description: Angstrom GNU/Linux v2012.12 (Core edition)
Release: v2012.12
Codename: Core edition

uname -a
Linux beaglebone 3.8.13 #1 SMP Wed Sep 4 09:09:32 CEST 2013 armv7l GNU/Linux

I'm happy to come back with any additional info.

Thanks,
Stuart

Datasheet for ADXL375:

http://www.analog.com/static/imported-f ... 
DXL375.PDF<http://www.analog.com/static/imported-files/data_sheets/ADXL375.PDF>

User guide for the breakout board for my accelerometer (ADXL375Z) in case 
it is helpful:

http://www.analog.com/static/imported-f ... 
_Guide.pdf<http://www.analog.com/static/imported-files/user_guides/EVAL-ADXL375_User_Guide.pdf>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to