wisskar / souliss

Automatically exported from code.google.com/p/souliss
0 stars 0 forks source link

nRF24L01 with SPI in Software #78

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It has been noted that some Ethernet boards doesn't support a proper sharing of 
MISO on SPI, the result is that is impossible to drive two different SPI 
devices, even if there is a proper handling of CS.

This require as hardware solution the use of a tristate buffer in order to 
release the MISO. As software alternative it can be used a software SPI for one 
device and an hardware one for the other.

The nRF24L01 driver by Maniacbug has this option that could be integrated into 
Souliss at compile time.

https://github.com/maniacbug/RF24/pull/34/files

Original issue reported on code.google.com by dario.di...@souliss.net on 16 Aug 2014 at 11:46

GoogleCodeExporter commented 9 years ago
What ethernet boards have this problem?

I tried with ENC28J60 with no problems.

Original comment by JuanPin...@gmail.com on 25 Nov 2014 at 6:11

GoogleCodeExporter commented 9 years ago
It mostly depend on the shield that has been used.

Original comment by dari.dim...@gmail.com on 25 Nov 2014 at 6:19

GoogleCodeExporter commented 9 years ago
Done in a561329dab6f.

At begin of your sketch (before the includes) add:

...
#define nRF24SPI_INSKETCH
#include "DigitalIO.h"

// Define the pins that you are willing to use

#define SOFT_SPI_NRF24_MISO_PIN 16
#define SOFT_SPI_NRF24_MOSI_PIN 15
#define SOFT_SPI_NRF24_SCK_PIN  14
#define SPI_NRF24_MODE          0

SoftSPI<SOFT_SPI_NRF24_MISO_PIN, SOFT_SPI_NRF24_MOSI_PIN, 
SOFT_SPI_NRF24_SCK_PIN, SPI_NRF24_MODE> nRF24SPI;

// from here continue with the Souliss Sketch
....

Original comment by dario.di...@souliss.net on 9 Dec 2014 at 2:11

GoogleCodeExporter commented 9 years ago

Original comment by dario.di...@souliss.net on 9 Dec 2014 at 2:11