This value was without Direct Port manipulation. With port manipulation, there is difference of 2 usec. So, with just 2 usec when the single call is taking around 248 usec there isn't much difference...plus code looks non-arduinoic.
From Reply #32 and your test codes:
It takes 248 usec when I just call Dx() and 1048 usec if I send print over serial, using Serial.print(Dx()).
void setup()
{
Serial.begin(9600);
Serial.begin("start");
unsigned long before = micros();
Dx(); // Takes 248 usec
// Serial.print(Dx()); // Takes 1048 usec
unsigned long duration = micros() - before;
Serial.println(duration);
}
No idea know, what else could be done.
Thought of using Ethernet with Maple because it has 2 SPI but then it has no Ethernet library yet!
There is also CAN bus support and I could get the CAN-USB converter. How would it be with CAN bus, anybody got idea?
Will check the post you attached. Maybe it can change something. I only fear that I have 10 byte of data and if I have to write to SD card then maybe I had to open and close the file on each iteration. That seems a crazy idea to me.