Thanks Mike. I've re-wired it 8 times now and re-checked many more so highly doubtful there are any pin conflicts: cc3000 has CS 8, VBAT 5, IRQ 3. nrf24l01 has CE 6, CS 7. They share CLK 13, MISO 12, MOSI 11.
At this point I really think there's something in cc3000.begin() that's messing with the nrf24l01. The following code
Code: Select all
#include <Adafruit_CC3000.h>
#include <ccspi.h>
#include <SPI.h>
#include <RF24.h>
// These are the interrupt and control pins
#define ADAFRUIT_CC3000_IRQ 3 // MUST be an interrupt pin!
// These can be any two pins
#define ADAFRUIT_CC3000_VBAT 5
#define ADAFRUIT_CC3000_CS 8
// Use hardware SPI for the remaining pins
// On an UNO, SCK = 13, MISO = 12, and MOSI = 11
Adafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS, ADAFRUIT_CC3000_IRQ, ADAFRUIT_CC3000_VBAT,
SPI_CLOCK_DIV2); // you can change this clock speed but DI
uint64_t remoteAddress = 0x00000000F2;
RF24 radio(6,7);
void setup(void)
{
Serial.begin(115200);
Serial.println(F("Hello, CC3000!\n"));
radio.begin();
radio.setRetries(15,15);
radio.setPayloadSize(16);
radio.setPALevel(RF24_PA_HIGH);
radio.setDataRate(RF24_250KBPS);
radio.setCRCLength(RF24_CRC_16);
radio.setChannel(0x77);
radio.openReadingPipe(1,remoteAddress);
Serial.println(F("\nInitialising the CC3000 ..."));
if (!cc3000.begin()) {
Serial.println(F("Unable to initialise the CC3000! Check your wiring?"));
for(;;);
}
}
void loop(void) {
if ( radio.available() ) {
char data[16];
bool done = false;
while (!done) {
done = radio.read( &data, sizeof(data) );
delay(20);
}
for (int i=0; i<16; i++){
Serial.print(data[i]);
}
Serial.println("<-radio output");
}
delay(1000L); // Pause 5 seconds
}
Produces the following output:
Code: Select all
Hello, CC3000!
Initialising the CC3000 ...
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ<-radio output
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ<-radio output
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ<-radio output
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ<-radio output
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ<-radio output
With the problem obviously being I never even call radio.startListening() - the nrf should not be hearing anything. I can even comment out all the nrf setup except for radio.begin() and it produces the same output. Even if I add radio.stopListening() and/or digitalWrite(7, HIGH);digitalWrite(6, LOW); after the cc3000.begin I get the same output. Swap the order of cc3000.begin and radio.begin - same output. If I comment out cc3000.begin() the nrf is quiet as it should be.
I've re-installed my Arduino IDE and the maniacbug/RF24 and Adafruit_CC3000 libraries just in case there was some issue there, but no dice. If someone with these components could give this a try to confirm or refute my problem or give me any kind of direction I'd really appreciate it.