Pages: [1]   Go Down
Author Topic: How robust is SDlib to other interrupts  (Read 577 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 0
Posts: 179
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm wanting to add a short ISR to handle some external hardware (write a byte to set PWM duty cycle).

I'll need to know how tolerant the SPI writing in SDlib is to the timing delays this will introduce.

Since the actual SPI timing is done by the SPI hardware in the chip and each byte is effectively buffered, I'm guessing it should be possible.

I'll just do some experimenting but any direct experience and possible caveats would be useful.

Thanks.


 
« Last Edit: September 12, 2012, 01:06:53 pm by ardnut » Logged

0
Offline Offline
Edison Member
*
Karma: 63
Posts: 1604
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

SD cards seem to be very tolerant for delays in SPI transfers.  I have delayed for many milliseconds mid-transfer with no problem.

Many people call analogRead() for several pins in an ISR while data is being written to the SD with no problem.  Each call takes about 120 microseconds.

SdFat uses millis() to detect timeout errors so spending more than a millisecond in an ISR will cause millis() to drop counts.  This should just extend the length for a timeout error.
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 179
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Many thanks. That's just what I was hoping was the case. Thanks for the detail.

Logged

Pages: [1]   Go Up
Jump to: