On 08/01/14 07:12, Peter wrote: > 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, -- Jack Mitchell ([email protected]) Embedded Systems Engineer Cambridgeshire, UK http://www.embed.me.uk -- -- 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/groups/opt_out.
