I am trying to communicate with two different devices on the single Teensy3.1 SPI interface, i.e. an ADC (ADS1220) and a micro SD card, using the SDFat library for it's SD idle/sleep capabilities. Currently, I have a working program that uses the simpler SD library to initialize and read the SD card, then I initialize the ADC, while making the chipselect on the SD card high. Just a little background, the SD card stores about 30 different bitmaps for the LCD display and the ADC is a high precision 24-bit, low offset voltage unit that is used to sample small amplified measurements from a strain gage wheatstone bridge circuit. Before each ADC read sample, I change the SPI mode from mode0, while working with the SD card, to mode1, to work with the ADC. The ADC is able to read accurate voltage measurements from the circuit during conversions, then once the user inputs a display change the ADC will momentarily stop conversions and then the SD card is read for bitmaps. My only issue is that the SD card is not allowed to sleep with the SD library I am using and draws way too much current, this is a major problem since my project is battery powered. I have read all of the SD low power posts from: http://forum.arduino.cc/index.php?topic=149504.0; I am also unable to cycle the power on the SD card to save power, since the SD library will not let me reinitialize the SD card.
What I am striving to do is use the superior SDFat library with its low power idle capabilities instead of the simpler SD library. I have altered my program to use the SDFat library in exchange for the SD library. While the SD card works perfectly, the ADC however does not function properly. What I have discovered is that once the SDFat library initializes the SD card, it changes the teensy3.1 SPI settings for optimized use with the SD card, however I do not know how to change these SPI settings back to default values during ADC conversions, then once the program needs to read the SD card again revert back to the SDFat SPI settings for the card.
The only wall hindering me from solving this issue is my lack of knowledge on the architecture of the SDFat library and how it alters the SPI interface with the Teensy3.1 microcontroller. I have been searching through the C++ files to find any changes in the SPI interface, but the only program I can clearly see changes in is with the SdSpiArduino.cpp program, which changes the SPI mode and divisor. These are the only SPI changes I make while working with the other SD library and that setup works, however when doing the same with the SDFat library chaos ensues. It is my understanding that the SD library is a derivative of the SDFat library, therefore theoretically this should work on either..
Any help on this matter will be greatly appreciated!