Community news, upcoming events and general discussions
Threads: 36 Posts: 88
Get technical support from the community
Threads: 1397 Posts: 7498
Threads: 18 Posts: 64
Tell us how to make XDK better!
Threads: 36 Posts: 119
Share and discuss community member projects
Threads: 76 Posts: 337
I am using the following function readAccelerometer to store the z axis acceleration value in a linked-list.
Hi Ankit, not all the 128kB RAM is available for the user. A good logging/cacheing application will need more design and it is out of scope of a free advisory, but I will give some further recomendations: Try cacheing as much data as possible before sending it out via the serial port or logging it into sd-card memory. Some 1s-2s of data can stay in RAM and can be written in bulk into the SD-card thus reducing the amount of write operations. The best options is to use an amount of data that fills and is aligned to the block size of the medium.
I also see that the data retrieval is happening in the timer-task context which should have a high priority. Depending of what you execute, this will block lower prioritized tasks or services.
Try to have an application with a data acquisition process triggered by a timer and a data forwarder or storage process which will take care of streaming or storing the information. Best Regards, Francisco