SPI1.1 not reading data as master

Hi All

I’m having issues with reading a two byte data stream from a slave Arduino with a BBB as Master.

The voltages on the pins indicate that the MISO pin on the BBB is recieving the correct voltages for a successful transmission of the slave replying with the correct data.

However in software the data is not correct. For example I expect [0, 114] to be replied but the software output indicates [247, 247] and then [255, 255] on subsequent transmissions

The device tree overlay is as per that given by hipster circuits: http://hipstercircuits.com/enable-spi-with-device-tree-on-beaglebone-black-copy-paste/

And I am using the SPI library provided by IOoo/piranna. https://github.com/piranha32/IOoo/blob/master/include/SPI.h

The Write function works accurately, however when recieving a reply both the spi::xfer1 and spi::read both return incorrect (but different) values.

I’ve got hardware to conduct level conversion on that pin to bring it to 3.3V which works. Additionally both devices are in SPI mode 1.

I’m just out of ideas as to what could be wrong. Any suggestions?

cheers

Peter

The device tree overlay is wrong. Use the one supplied with your
distribution or change the line:

0x190 0x13 /* P9_31 = mcasp0_aclkx.spi1_sclk ,
OUTPUT_PULLUP | MODE3 */

to

0x190 0x33 /* P9_31 = mcasp0_aclkx.spi1_sclk ,
INPUT_PULLUP | MODE3 */

I don't know anything about the IOoo library but I know that libsoc
works well for interfacing with the SPI bus.

https://github.com/jackmitch/libsoc

Cheers,

Yep you’re correct.

I found this info in a previous post you may have answered, and it does the job.

cheers

Peter

You should email the blog maintainer asking them to update and/or remove
the offending article.

Cheers,