piface / pifacecommon

Common functions for interacting with PiFace products
GNU General Public License v3.0
42 stars 30 forks source link

Update to set explicit SPI frequency #23

Closed johan162 closed 6 years ago

johan162 commented 6 years ago

In newer kernels 4.1.+ the default SPI frequency is set to the theoretical maximum based on the clock. This will also become the default frequency unless set specifically.

Since the current code does not set frequency explicit the pifacecaad will not work since the freq is far too high. This patch sets the frequency back to 100kHz and hence allows the board to work with newer kernels.

knarrff commented 6 years ago

I can confirm that without this change the piface isn't detected, and the patch fixes it. What I couldn't find was the value used before: I cannot confirm that 100000 is the best value to use. 10000 also seems to work (typo), as does 15000 (as suggested here: https://www.raspberrypi.org/forums/viewtopic.php?t=196248).

tompreston commented 6 years ago

Yeah looks good, thanks.