using interrupts vs. polling of ADS1299
I have a 32bit version that was working fine until yesterday. I wanted to change the chipkit code to get the data from ADS1299 via interrupts instead of polling it. I reprogrammed my board many times to develop this. I have got a code that I think that works but suddenly the ADS_DRDY pin wouldn't go low at all. I couldn't figure out where the problem was and so I reprogrammed the board with the original code but still it doesn't work. It connects to the Processing GUI without any problem but wont give any data. I am disappointed only a little because I lost my 500$ board but mainly because I couldn't test my code. Anybody who resolved similar problem please comment how you resolved it.
EDIT: Sorry my bad. I was using the wrong library settings in the tools.
Comments
Regards,
William
The interrupt scheme will allow samples to not be lost while the heavy compute tasks are running. When those library calls complete, control goes back to the main loop where the interim samples are now handled or buffered.
yes interrupts is the best approach.
I hesitated to use them because I was afraid to break some time dependent processes during SD card writing...
For exemple is it possible to interrupt and release the SPI bus during any step of the 512 multiblocks writing?
It is out of my competence ...
Another exemple, one can read in the ADS1299 data sheet that the fact to release the spi bus re-initializes the communication process, is it more or less the same in some cases for the SD card ?
By principle the SPI bus is fully interruptable but not all the devices that use it... it's a pity...
( I or you, could try , there is not a lot to do from the pooling approach code, as soon I have time I'll try to see if the card explodes)
If the new card called "ganglion" uses the 2 spi bus of the pic32 to dedicate one of them to the SD card, then it would be very efficient to use interrupts.
A last point : into some SD card (at least the one I use ) internal managment is such that , time to time, to write is not enable for rather long period of time (150mS on mine) then at "hight" sample rate , lets say 16k, we need big circular or "double buffer" to not to lost the data.
At least : 16x150x32 octes (and double if daisy)...
Sorry for my english...
Yannick.
Good news,
what has been your motivation ?
- Overruns ellimination?
- Sample rate increase?
- Background task?
- ... ?
In any case , a big thank !!!
Yannick.