Jump to content

Orange Pi Zero SPI not working


Julian85

Recommended Posts

So far I have found out (and tested) that the SPI0 which is tied to the Flash memory on the back (OPI Zero with 512MB ) works, however for some reason channel 1 is still blocked, and it is the only one accessible from the I/O pins.

Link to comment
Share on other sites

So , besides the fact that i'm blind as a bat , the problem was a file path in the SPI library.

To be able to use the SPI lib for OrangePi Zero you need to go to the source file of the library and change the path name from 

const static char  *spiDev1  = "/dev/spidev0.1";

 

to 

 

const static char *spiDev1   = "/dev/spidev1.0";

 

that is it

it worked for me and i can use the SPI lib.

 

L.E. I checked the github , it was fixed, but if by any chance you download other versions check this issue.

Link to comment
Share on other sites

I did not checked if that was the case but since this library was made originally for raspberry pi and the person who modified the lib for OPZ forgot to change the file path to the proper driver.  I do think these boards deserve more support but i'm kinda new to linux. 

Link to comment
Share on other sites

If you are using mainline I have a suggestion.  If you're using legacy, this doesn't apply.  In another thread @ldiaz helped me get an spi display working.  The solution was to add the following to the end of /boot/armbianEnv.txt and reboot.

 

overlays=spi-spidev
param_spidev_spi_bus=1

 

But like I said, this is for mainline, not legacy.

Link to comment
Share on other sites

I have dealt with LCD 's up to 800x480 px but with paralel interface and using MCU. After solving this SPI issue i was thinking of giving a try to use the SPI to push data out for the LCD that I already have. I'm not sure yet how to aproach this since i have more experience with MCU rather than SbC and linux. But that is why i am here, to make this transition to SbC. :)

 

Thanks for the advice, i'l be keeping an eye on your thread.

Link to comment
Share on other sites

I know your issue with SPI has been solved, I ran into the spidev1.0 dealio myself but just thought I'd quick mention what SPI library I've used in the past, additionally what I will be testing/trying to get working in the future.

 

I use this SPI library, specifically coded for OrangePiZero: https://github.com/rm-hull/OPi.GPIO
So far as I can tell it's used practically verbatim to other SPI libraries I've seen. ie: pyA20.gpio, ports of RPi.GPIO, WiringOP and the such.


I plan on also using the same authors libraries for using or testing OLED/LCD screens that I have. (SSD1306/PCD8544/ST7735/Etc...
https://github.com/rm-hull/luma.oled

Link to comment
Share on other sites

I tested the SPI speeds today, up to 8MHz on the logic analyzer and from 8 to 32MHz with 74HC595, data came out right but without a scope or a logic analyzer that can go beyond 32 MHz I can't confirm that.

That means you can push 4MBps which is enough for LCD's up to 800x480 at a low fps or 480x320 at a decent fps. 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines