SPI communication (python)

Post Reply
SofiaRafael
Posts: 5
Joined: Fri May 31, 2019 1:53 am
languages_spoken: english
ODROIDs: ODROID C0 and C1
Has thanked: 3 times
Been thanked: 0
Contact:

SPI communication (python)

Unread post by SofiaRafael » Fri May 31, 2019 2:10 am

Hello,

I have been trying to interface the ODROID C1 with an ID through SPI. I have verified that the IC is detected with the ls /dev/spidev*, however, I haven't managed to write or read messages from it. Is there any library in python or wrapped in python you can suggest me to implement this interface.

Thank you in advance for your reply,
Best wishes,
Sofia

User avatar
odroid
Site Admin
Posts: 31305
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 44 times
Been thanked: 179 times
Contact:

Re: SPI communication (python)

Unread post by odroid » Fri May 31, 2019 10:03 am

We have only C code example for SPI.
https://wiki.odroid.com/odroid-c1/appli ... e/gpio/spi

The UART could be used with WiringPi Python wrapper.
https://wiki.odroid.com/odroid-c1/appli ... l_loopback

So it is worth to check the SPI API in WiringPi Python library.
These users thanked the author odroid for the post:
SofiaRafael (Mon Jun 03, 2019 11:53 pm)

SofiaRafael
Posts: 5
Joined: Fri May 31, 2019 1:53 am
languages_spoken: english
ODROIDs: ODROID C0 and C1
Has thanked: 3 times
Been thanked: 0
Contact:

Re: SPI communication (python)

Unread post by SofiaRafael » Sat Jun 01, 2019 2:07 am

Hello,

Thank you very much for your quick reply.

I have managed to do the SPI communication with the repository https://github.com/hardkernel/WiringPi2-Python. However, I am having a problem with the SPI communication since I am not able to control CE state. I want to be able to toggle between the high and low values, do you have any way of doing so?

Thank you very much in advance,
Best,
Sofia

User avatar
odroid
Site Admin
Posts: 31305
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 44 times
Been thanked: 179 times
Contact:

Re: SPI communication (python)

Unread post by odroid » Mon Jun 03, 2019 9:35 am

Do you want to change the polarity of the CE pin?
If yes, try '-C' option in "spidev_test" application software.

Code: Select all

-C --cs-high  chip select active high
These users thanked the author odroid for the post:
SofiaRafael (Mon Jun 03, 2019 11:52 pm)

Post Reply

Return to “Hardware and peripherals”

Who is online

Users browsing this forum: No registered users and 1 guest