Hey Joe, spi0 on my BBGW also gave me the wrong result when I ran the spi test code by shorting p18 and p21. How did you solve your problem? Replace the cap????
On Tuesday, November 15, 2016 at 6:58:35 AM UTC+8, Joe Phaneuf wrote: > > Hey, cross posting from seeed studio forums. > > > tldr: clocking in data on spi0 looks cattywompus, spi1 ok > > Was noticing an issue with some custom hardware/software that utilizes > both spi channels, was working on beaglebone black prior. Wanted to make > it easily reproducible so flashed a bbgw and used adafruit bbio library as > an example. > > steps: > > 1.) flash BBGW with latest production image 4.4.15-ti-r37 (other kernel > versions and imaged used as well) > > 2.) prevent sound drivers from loading, as they conflict with spi1: > > cd /lib/modules/4.4.15-ti-r37/kernel/sound/core > > mv snd.ko snd.ko.bkp > > 3.) install adafruit library from source (need latest greatest, pip > upgrade didn't work) > > cd ~ > git clone > https://github.com/adafruit/adafruit-beaglebone-io-python.git > cd adafruit-beaglebone-io-python > python setup.py install > cd .. > > 4.) reboot > > 5.) use wires to loopback MOSI to MISO, both channels > > short P9.18 and P9.21 with a piece of wire (SPI0) > > short P9.29 and P9.30 with a piece of wire (SPI1) > > 6.) put the following into a file and run it > > from Adafruit_BBIO.SPI import SPI > def run(x,y): > > print 'running spi {} {}'.format(x,y) > spi = SPI(x,y) > spi.mode=2 > spi.msh=4000000 > bytes2send = range(20) > print 'sending {}'.format(bytes2send) > print spi.xfer2(bytes2send) > spi.close() > > run(0,0) > run(1,0) > > result: > sending [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, > 19] > [128, 7, 28, 31, 112, 231, 124, 127, 192, 135, 156, 159, 240, 231, 252, > 255, 0, 7, 28, 31] > running spi 1 0 > sending [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, > 19] > [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] > > so, spi1 works in loopback. spi0...wtf? there are places where it looks > like it's double clocking MISO (like a 0x00000001 becomes a 0x00000011), > some of it just looks random. Works fine on beaglebone black. > > Thoughts? > If anyone has spi0 working on a bbgw would love to hear about the setup. > Thanks! > -- 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]. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/5d5ea604-18b5-453a-8258-3ed3f0fc29a6%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
