SDcard Logger with FIFO and FIR Filter (FreeRtos)

Post here first, or if you can't find a relevant section!
victor_pv
Posts: 1045
Joined: Mon Apr 27, 2015 12:12 pm

Re: SDcard Logger with FIFO and FIR Filter (FreeRtos)

Postby victor_pv » Mon Feb 13, 2017 3:20 pm

michael_l wrote:This is the closest I could find based on your recommendation. Quite many seem to have LDO regulator. This one does not but it still has some resistors. Can you recommed this ? Thanks.

http://www.ebay.co.uk/itm/LC-Technology ... SwARZXoem~


Michael that should work, and in the worst case if the resistors affect some way, you can just short them with a blop of solder, but you won't likely need to do that.

stevestrong
Posts: 870
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: SDcard Logger with FIFO and FIR Filter (FreeRtos)

Postby stevestrong » Mon Feb 13, 2017 3:23 pm

michael_l wrote: Can you recommed this ? http://www.ebay.co.uk/itm/LC-Technology ... SwARZXoem~

This is an alternative: https://www.aliexpress.com/item/1Pcs-Mi ... 76747.html

@BennehBoy, your data recording rate/amount (4Hz/20bytes) should work without any problem.

User avatar
Pito
Posts: 792
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: SDcard Logger with FIFO and FIR Filter (FreeRtos)

Postby Pito » Tue Feb 14, 2017 12:08 pm

victor_pv wrote:
michael_l wrote:This is the closest I could find based on your recommendation. Quite many seem to have LDO regulator. This one does not but it still has some resistors. Can you recommed this ? Thanks.

http://www.ebay.co.uk/itm/LC-Technology ... SwARZXoem~


Michael that should work, and in the worst case if the resistors affect some way, you can just short them with a blop of solder, but you won't likely need to do that.

That Sdcard module works fine, I am using it, I recommended it in a separate post already.
viewtopic.php?f=9&t=1701

Do NOT short the resistors, as those resistors are the 10k pull-ups.

User avatar
Pito
Posts: 792
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: SDcard Logger with FIFO and FIR Filter (FreeRtos)

Postby Pito » Tue Feb 14, 2017 12:21 pm

BennehBoy wrote:So, question, am I likely yo be impacted by this or is my output volume 'under the threshold'?

As described above, the writing onto an Sdcard depends on many factors..

michael_l
Posts: 273
Joined: Mon Aug 24, 2015 6:11 pm

Re: SDcard Logger with FIFO and FIR Filter (FreeRtos)

Postby michael_l » Sat Mar 11, 2017 5:21 pm

Thanks guys, been too busy with other tasks but now got a change to try this. When I insert the cars blue board resets - is this normal and what causes this ?

User avatar
Pito
Posts: 792
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: SDcard Logger with FIFO and FIR Filter (FreeRtos)

Postby Pito » Sun Mar 12, 2017 8:42 am

It is not normal when you insert the sdcard and the BP resets.
Double check wiring. The sdcard module needs 3.3V.
Last edited by Pito on Sun Mar 12, 2017 6:04 pm, edited 1 time in total.

zmemw16
Posts: 1059
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: SDcard Logger with FIFO and FIR Filter (FreeRtos)

Postby zmemw16 » Sun Mar 12, 2017 2:27 pm

card detect switch crossed with the reset line ?
minor edit
Last edited by zmemw16 on Sun Mar 12, 2017 6:19 pm, edited 2 times in total.

User avatar
Pito
Posts: 792
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: SDcard Logger with FIFO and FIR Filter (FreeRtos)

Postby Pito » Sun Mar 12, 2017 6:07 pm

Also check with an ohmmeter the possible shorts between the sdcard's socket pins (all combinations). The socket disconnected from BP during the measurement..

sherinkapotein
Posts: 20
Joined: Thu Apr 06, 2017 6:53 am

Re: SDcard Logger with FIFO and FIR Filter (FreeRtos)

Postby sherinkapotein » Sat Apr 08, 2017 12:16 pm

A quick question on the fundamental functioning of RTOS version of SD logging.
I have been working on arduinos for a few months now and how I understand the SD library works is by creating a 512B buffer and every request to Write on SD is pushed on to the Buffer. The buffer is finally written on SD card when its nearing full. So when I compute the time required for writing data to SD card in a loop a byte at a time, I get like few dozen microsecs for most transactions and one odd write in the range 5-200 ms (or maybe more at times).

When we use the RTOS implementation is the same basic being followed? If yes, then would someone elaborate on the given situation
-The producer thread produces 1B every ms and that needs to be written to SD card.
-The consumer thread just writes to SD card.

The producer thread being of higher priority is woken up every ms and the task it does takes about 300micro secs(say). So when the SD library buffer fills up and its time to actually write to the SD card. The CPU makes access request to write to SD card and due to the latencies involved being of the order of several ms, the request is interrupted in between and the cpu switches to producer thread which writes to the FIFO as usual. After doing its task, the producer sleeps again and the request generated by the consumer thread, which was interrupted in between earlier, is re-initiated again resulting in generating similar write latencies as before. By this logic a successful write can never take place, but since it does I know that my understanding of its functioning is flawed.

I need to understand this so that i can structure my code accordingly. Thanks in advance. i know my explanatory (if thats a word) skills are a mess.

victor_pv
Posts: 1045
Joined: Mon Apr 27, 2015 12:12 pm

Re: SDcard Logger with FIFO and FIR Filter (FreeRtos)

Postby victor_pv » Sun Apr 09, 2017 1:53 am

When a thread is resumed, it doesn't restart, it resumes from the point in which it was interrupted.

So you have your writer thread waiting for the SDcard to respond to a command, but the sdcard is busy doing whatever an sdcard does, and will take 50ms to respond. In this case the writer thread must be in a loop waiting for the correct reply right?
While in that loop, the scheduler interrupts it and resumes a different thread (call it sensor thread), which takes 500uS to complete, and then goes to sleep for 100mS. When the sensor thread goes to sleep, the scheduler looks at what is the next active thread to run. The writer thread was not sleeping, it was waiting in a loop and was interrupted, so when resumed goes back to that same loop, and keeps waiting for the correct reply from the sd card.
That thread can be interrupted and resumed many times while in the loop, but eventually the sdcard replies back and the writer thread continues with it's writing process.

Does that clarify it?


Return to “General discussion”

Who is online

Users browsing this forum: ag123, Pito and 3 guests