bablokb
Posts: 21
Joined: Fri Nov 07, 2014 7:45 am

Newest python-spidev broken?

Sat Jan 13, 2018 1:29 pm

Since updating my python-spidev recently (from 2.0~git20150907+rpi1 to 20170223~145721-1) my program reading an ADC does not work anymore. The old version was part of Jessie and also was provided by Stretch-light version 2017-09-07. After reverting manually, it worked again. I'm only using open and xfer to read the ADC channels, so I wonder what is going on.

My specific questions are:
  • is there a way to downgrade the python-spidev package with apt-get?
  • where is the source-code of these package-versions maintained? I would like to see what really changed.
  • Maybe I now have to change my code (e.g. add options or so). Any ideas? I already discovered that the new code returns the answer for the
    xfer call not only as a return value, but also overwrites the control-bytes I send which is annoying but I can work around that problem. But only changing this is not enough.
Thanks, Bernhard

User avatar
DougieLawson
Posts: 32352
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Newest python-spidev broken?

Sat Jan 13, 2018 3:00 pm

Try

Code: Select all

spi.max_speed_hz = 50000
with a suitable value for the frequency.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

bablokb
Posts: 21
Joined: Fri Nov 07, 2014 7:45 am

Re: Newest python-spidev broken?

Sun Jan 14, 2018 6:47 am

with a suitable value for the frequency.
Is this a matter of trial-and-error? Or is "max_speed_hz" another name for the throughput rate given in the datasheet?

User avatar
DougieLawson
Posts: 32352
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Newest python-spidev broken?

Sun Jan 14, 2018 10:18 am

bablokb wrote:
Sun Jan 14, 2018 6:47 am
with a suitable value for the frequency.
Is this a matter of trial-and-error? Or is "max_speed_hz" another name for the throughput rate given in the datasheet?
Max from the datasheet.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

Return to “Interfacing (DSI, CSI, I2C, etc.)”

Who is online

Users browsing this forum: No registered users and 7 guests