I'm trying to log AD345 data via SPI on InterruptIn and write it to an open local file with fwrite() in binary directly from the interrupt routine. I find that my ideal data rates are right on the margin for the flash memory. It is almost OK at 192 bytes per 20mSec (800s/s) but quite marginal at 192 bytes/10mSec. (the fifo on the AD345 gives a bit of leeway). Average measured single buffer dump seems to be about 15mSec but some are a lot longer (in some areas of the flash, changing block, cell errors?). It's the long fwrites() that are the real problem - occasionally >50mSec or more.
What is the fwrite() buffer size? Can it be changed?
The fwrite() appears to mask InteruptIn, does it? Also does pc.printf() mask it?
When using InterruptIn I can't get wait() to flash my led - low interrupt priority?
Chould I expect faster write speeds with a SD card FAT file system, or do I need to go to a raw storeage?
- Given that fwrite() masks the interrupt, I don't gain by fwriting as a forground task because I loose control of the relative timing. Any suggestions?
Thanks,
I'm trying to log AD345 data via SPI on InterruptIn and write it to an open local file with fwrite() in binary directly from the interrupt routine. I find that my ideal data rates are right on the margin for the flash memory. It is almost OK at 192 bytes per 20mSec (800s/s) but quite marginal at 192 bytes/10mSec. (the fifo on the AD345 gives a bit of leeway). Average measured single buffer dump seems to be about 15mSec but some are a lot longer (in some areas of the flash, changing block, cell errors?). It's the long fwrites() that are the real problem - occasionally >50mSec or more.
What is the fwrite() buffer size? Can it be changed?
The fwrite() appears to mask InteruptIn, does it? Also does pc.printf() mask it?
When using InterruptIn I can't get wait() to flash my led - low interrupt priority?
Chould I expect faster write speeds with a SD card FAT file system, or do I need to go to a raw storeage?
- Given that fwrite() masks the interrupt, I don't gain by fwriting as a forground task because I loose control of the relative timing. Any suggestions?
Thanks,