Hi,

I am using the adafruit's BBIO library.
Sample code:

from Adafruit_BBIO.SPI import SPI
from time import sleep

spi = SPI(0, 0)
for i in range(255):
     print i, spi.xfer2([i, 0])
     sleep(5)



On Friday, 9 February 2018 01:58:53 UTC+5:30, pierric...@gadz.org wrote:
>
> Hi, 
>
> OK, I missed it when reading the pot's documentation, my bad. 
> Could you tell me what is the code for the SPI(x,y) function/library you 
> are using on the BeagleBone ? I used SPI between PRUs and an accelerometer 
> once, and I encourtered a similar problem, which finally came form the SPI 
> phases. However I never used it directly from the ARM. 
> Thanks
>
> Pierrick
> Le jeudi 8 février 2018 08:48:48 UTC-5, Kaarkuzhali Murugan a écrit :
>>
>> Hi, 
>>
>> AD8403 has a SDO pin (Pin 13).
>> And my issue is in transferring the data to the pot. I meant to say, 
>> whatever value I pass to the pot, resistance is not changing. But when I 
>> use an arduino board, resistance is changing.
>>
>>
>> Regards,
>> Kaarkuzhali Murugan
>>  
>>
>> On Thursday, 8 February 2018 02:39:31 UTC+5:30, pierric...@gadz.org 
>> wrote:
>>>
>>> I maybe of the track, but the AD 8403 seems to be a 3 wire SPI, then I 
>>> do not understand why your setting up 4 pins on the BBB
>>>
>>> Thanks 
>>>
>>> Pierrick
>>>
>>> Le mercredi 17 janvier 2018 10:27:43 UTC-5, Kaarkuzhali Murugan a écrit :
>>>>
>>>>
>>>> I am working with a beaglebone black and I want to transfer data to my 
>>>> potentiometer (AD 8403). BBB is the master and pot is the slave.
>>>>
>>>> My beaglebone settings:
>>>>
>>>> 1) *uname -a *
>>>> Linux beaglebone 4.9.59-ti-r74 #1 SMP PREEMPT Thu Nov 2 06:20:31 UTC 
>>>> 2017 armv7l GNU/Linux
>>>>
>>>> 2)* cat /etc/dogtag*
>>>> BeagleBoard.org Debian Image 2017-11-05
>>>>
>>>> 3) *cat /etc/debian_version *
>>>> 9.2
>>>>
>>>> 4) *cat /sys/devices/platform/bone_capemgr/slots* 
>>>> cat: /sys/devices/platform/bone_capemgr/slots: No such file or directory
>>>>
>>>> 5) *ls -al /dev/spi**
>>>> crw-rw---- 1 root spi 153, 1 Nov  3  2016 /dev/spidev1.0
>>>> crw-rw---- 1 root spi 153, 0 Nov  3  2016 /dev/spidev1.1
>>>> crw-rw---- 1 root spi 153, 3 Nov  3  2016 /dev/spidev2.0
>>>> crw-rw---- 1 root spi 153, 2 Nov  3  2016 /dev/spidev2.1
>>>>
>>>> 6) Pins are configured through config pin
>>>>
>>>> config-pin P9_17 spi_cs
>>>> config-pin P9_18 spi   
>>>> config-pin P9_21 spi
>>>> config-pin P9_22 spi_sclk
>>>>
>>>> 7) *cat /etc/default/capemgr* 
>>>> # Default settings for capemgr. This file is sourced by /bin/sh from
>>>> # /etc/init.d/capemgr.sh
>>>>
>>>> # Options to pass to capemgr
>>>> CAPE=BB-SPIDEV0
>>>>
>>>>
>>>> Loopback test is working fine but when I try to transfer any data to my 
>>>> pot, I am receiving [255] as the result. How to solve this issue?
>>>> *Loopback test example:*
>>>>
>>>> spi = SPI(0, 0)
>>>> print spi.xfer2([0, 0])
>>>> [0, 0]
>>>> spi.close()
>>>>
>>>> *When connected to pot:*
>>>>
>>>> spi = SPI(0, 0)
>>>> print spi.xfer2([0, 0])
>>>> [255, 255]  --> This is where the issue is.
>>>> spi.close()
>>>>
>>>>
>>>>
>>>> Thanks in advance.
>>>>
>>>> -Regards,
>>>> Kaarkuzhali Murugan. 
>>>>
>>>

-- 
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 beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/3e0ad2e2-ea28-431f-b9c5-71fe3a13f1b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to