Please select To the mobile version | Continue to access the desktop computer version

OrangePi

 Login            
 Register            
Search
Hot search: orangepi
View: 9535|Reply: 8

SPI usage

[Copy link]

5

Threads

23

Posts

104

Credits

Registered member

Rank: 2

Credits
104
Post time 2015-4-21 04:00:53 | Show all posts |Read mode
Is there anybody here who experimented with the SPI from the OPi yet?
Does somebody have a nRF24L01(+) chip and know if the library from http://tmrh20.github.io/RF24/ is fully compatible with the OPi?

(I don't have an OPi yet, but would like to use this library also on the OPi).

3

Threads

346

Posts

2464

Credits

Moderator

Rank: 7Rank: 7Rank: 7

Credits
2464
Post time 2015-4-21 04:40:53 | Show all posts
I can confirm SPI works. I am using some display with Orange so probably this should work too.

5

Threads

23

Posts

104

Credits

Registered member

Rank: 2

Credits
104
 Author| Post time 2015-4-22 03:16:13 | Show all posts
Thanks igorpec for confirming.
I will try this library as soon as I have an OPi.

5

Threads

23

Posts

104

Credits

Registered member

Rank: 2

Credits
104
 Author| Post time 2015-5-16 19:19:09 | Show all posts
Hi Igor,

Can you point me to the source code which you are using for the SPI interface?
The RF24 library is using a bcm2835 library, so at the moment this RF24 library can't be used yet.
I was thinking of making an OPi template for this library.

5

Threads

23

Posts

104

Credits

Registered member

Rank: 2

Credits
104
 Author| Post time 2015-5-16 22:18:50 | Show all posts
Edited by Johan at 2015-5-16 22:30

I'm using the following pins:
P01 : 3.3V
P25 : GND
P15 : CE
P19 : MOSI
P21 : MISO
P23 : SCLK
P24 : CSN

So I'm currently using:

RF24 radio(SUNXI_GPI(17), SUNXI_GPI(10), "/dev/spidev0.0");

Because I found the following in the OPi manual:

CON3-P15 UART2_CTS PI17
CON3-P24 SPI0_CS0 PI10

Maybe I'm not interpreting the manual correctly.

Edit: I'm using librf24-sunxi at the moment ( git clone https://github.com/mplatov/librf24-sunxi )
I did modprobe spi-sun7i and compiled the library for librf24-sun7i.

0

Threads

13

Posts

136

Credits

Registered member

Rank: 2

Credits
136
Post time 2015-11-20 19:57:13 | Show all posts
igorpec replied at 2015-4-21 04:40
I can confirm SPI works. I am using some display with Orange so probably this should work too.

could you give me more details?

3

Threads

346

Posts

2464

Credits

Moderator

Rank: 7Rank: 7Rank: 7

Credits
2464
Post time 2015-11-21 00:42:05 | Show all posts
http://www.armbian.com/orange-pi/
Just follow the guide.

0

Threads

1

Posts

10

Credits

Novice

Rank: 1

Credits
10
Post time 2016-12-5 21:26:33 | Show all posts
Johan replied at 2015-5-16 22:18
I'm using the following pins:
P01 : 3.3V
P25 : GND

Hi!
I have orange pi lite and I am triyng to connect a nRF24l01+ to it.
I followed your pin connections, did "make pingtest" and then runned it... It says i got a response even without an arduino sending it back! Weird!
And when i did "sudo modprobe spi-sun7i" it gives me:

modprobe: FATAL: Module spi-sun7i not found.

I'm running Armbian 3.4.112-sun8i.

Also spidev_test.c doesn't compile:

ricardo@orangepilite:~/Downloads/librf24-sunxi-master/test$ make spidev_test
g++ spidev_test.c -o spidev_test
spidev_test.c: In function ‘void transfer(int)’:
spidev_test.c:55:5: error: ‘struct spi_ioc_transfer’ has no member named ‘interbyte_usecs’
  tr.interbyte_usecs = 10;
     ^
Makefile:13: recipe for target 'spidev_test' failed
make: *** [spidev_test] Error 1

Can you help me?

0

Threads

3

Posts

55

Credits

Registered member

Rank: 2

Credits
55
Post time 2017-6-15 20:53:57 | Show all posts
I am interested in too...
You have to log in before you can reply Login | Register

Points Rules

Archiver|Mobile edition|Darkroom|OrangePi En ( 粤ICP备14086627号-2

2017-9-20 13:43 GMT+8 , Processed in 0.030128 second(s), 22 queries .

Powered by Discuz! X3.2

© 2014-2015 orangepibbs en.

Quick Reply To Top Return to the list