Adafruit_nrf8001 and SDFat problem on teensy 3.1

Status
Not open for further replies.
Was the Adafruit nRF8001 and SdFat compatibility ever solved?
I am seeking a solution where I have:
*BLE communication for starting Arduino measurement and plot data to phone
*Fast logging (5kHz) for 2 analog pins for 1 second.

I want to use SdFat, because Arduino cannot store all that data in SRAM. I understand BLE does not have a large bandwidth but transmission time not critical. I would be willing to pursue another solution if there is a known working one, however.

What I am trying to do:

while( ble.available() ) {
char c = ble.read();
if( c == 'r' ) { //record analog measurements
logData(); // call SdFat lib here..... or write my own??
}
if( c == 'd' ) { //dump data (instead of to serial, to BLE.write)
dumpData(); //send recorded data to iOS
}
}

Seems like you must switch SPI_MODE_0 and SPI_MODE_1 for SdFat and nRF8001 (respectively). In this case, While in the BLE loop, if you switch to SPI_MODE_0 to access the SD card, do you automatically lose connection to BLE? Seems like dumpData() would be the biggest problem, because you must keep switching between devices to send packets to iOS until data is all transmitted.

Would a feasible workaround be to use two Arduinos? One for data logging, and one for BLE transmission? If so, would using serial communication between the two be a compatible solution, where I will not run into SPI mode conflict?

Thanks and Regards,
Steven
 
As far as I know, nRF8001 and SD (but not necessarily SdFat) work together properly, if you use the copies from the Teensyduino installer.

I'm not sure if the SPI transaction stuff ever got back into Adafruit's official copy.
 
Status
Not open for further replies.
Back
Top