Hobbyist Toolkit

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with Raspberry Pi LabVIEW Linx

Solved!
Go to solution

Hi guys,

Is this a known issue with the Linx Toolkit? Error 5005 :(The Specified Channel is not available on the Raspberry Pi. According to the Pinout Diagram of the Pi GPIO Pin 8 = Raspberry Pi Channel 24. (Raspberry Pi 2 Model B LINX Pinout [LabVIEW MakerHub]) where the CS is set to be 24. I am trying to program a Max 7219 Matrix with LabVIEW Linx Toolkit and Raspberry Pi here. I also attached the VI (LV16) also in this post. Does anyone have any countermeasures to solve the SPI Issue with the Pi? Do let me know if you have any suggestions or feedback that I could work on it.

 

Thanks. 

Download All
0 Kudos
Message 1 of 5
(2,938 Views)
Solution
Accepted by topic author cyongjed

It's known in the sense that the extra CS configuration for the SPI port is somewhat misleading and can't really be disabled in current Linx.

 

On the Raspberry Pi (and Beaglebone Black) the CS handling is done by default through the platform SPI driver based on the device name that is used. CS0 is used for the "/dev/spidev0.1" and CS1 for the "/dev/spidev0.0" device. Linx only supports the "/dev/spidev0.1" device as SPI device 0. (naming schemes are usually arbitrary and seldom logical 😁)

 

The Linx library insists on doing some custom handshaking of its own, possibly a reminder of early Raspi driver implementations, or maybe simply a misunderstanding how SPI works on the Raspi in comparison to an Arduino.

 

Since this GPIO line is already used by the platform driver you can't use it as a custom CS configuration. The error you get is factually correct. Now it would be nice if Linx allowed to not use that custom handshaking, for instance by leaving this value 0, which is an invalid GPIO line, but it doesn't currently support that So you need to specify a GPIO here that you are not using anywhere else and let Linx toggle this signal just in vain.

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 5
(2,893 Views)

Hi Rolf,

Thanks for responding! After reading your reply, I am still a bit confused about the modifications to be done here as the Linx Toolkit API is quite limited. There isn't an API(in linx) to set the GPIO pins to specifically set the GPIO to set the CS Lines? In that case, how do I go about modifying it in LabVIEW to set the CS lines in order to toggle the signal? 

 

Regards,

Cyong

0 Kudos
Message 3 of 5
(2,873 Views)

@cyongjed wrote:

Hi Rolf,

Thanks for responding! After reading your reply, I am still a bit confused about the modifications to be done here as the Linx Toolkit API is quite limited. There isn't an API(in linx) to set the GPIO pins to specifically set the GPIO to set the CS Lines? In that case, how do I go about modifying it in LabVIEW to set the CS lines in order to toggle the signal? 


You don't need to. The driver itself will directly control that CS line according to the configuration of that port. This is why you can't assign this GPIO to be used by Linx. It is already in use by the SPI driver!

 

But as explained you can't disable the custom CS handling in Linx so you have to assign an unused GPIO pin to it so that Linx can control it.

 

Just be aware that Linx SPI 0 is /dev/spidev0.1 and therefore will control CS1. /dev/spidev0.0 (with CS0) is not supported currently by Linx.

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 5
(2,861 Views)

Hi Rolf, I have tried you suggestions that you gave. The VI now runs without any errors, but there is nothing on the Max 7219 Matrix Display. Seems like the Linx Toolkit failed me😂, as I had tried on the NI USB 8452 prior it was working, before modifying the code slightly with the Linx in it. Thanks for the help though, appreciate it!

 

Regards,

Cyong

0 Kudos
Message 5 of 5
(2,810 Views)