SD Card Component

Any bugs you encounter with Flowcode should be discussed here.
Post Reply
BenR
Matrix Staff
Posts: 1952
http://meble-kuchenne.info.pl
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 510 times
Been thanked: 698 times

SD Card Component

Post by BenR »

Hello,

I have found and fixed a bug in the SD card component code that caused a problem when a file size was greater then 256 sectors in length (131,072 Bytes). Took quite a while to pin it down. I've now rolled this change out to V8, V9 and V10 components and is available via the usual library updates.

I also have sped things up considerably for ESP32 related devices. The SPI speed wasn't changing from the initial slow speed and the sector buffer was being read a byte at a time both of which were having an impact.

If anyone has a go with the latest component then please let me know how you're getting on just in case I've broken something elsewhere.

stefan.erni
Valued Contributor
Posts: 1065
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 201 times
Been thanked: 225 times

Re: SD Card Component

Post by stefan.erni »

Hi Ben

I will test it soon.

One more question
With uart and bluetooth you can easily transfer an array with a singed integer. An array can then be written to a file using the built-in function in the App developer (append)
Would that also be a possibility for the SD card to append an singed integer array?
Would be very convenient for data or wave files.

https://flowcode.co.uk/forums/viewtopic.php?f=4&t=1133


regards

Stefan

BenR
Matrix Staff
Posts: 1952
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 510 times
Been thanked: 698 times

Re: SD Card Component

Post by BenR »

Hi Stefan,

Yes should be fairly easy to add read/write arrays to the component.

Let me have a look.

Edit. this is now done. Let me know how you get on, if it works ok I'll look at the AD version of the component too.

WingNut
Posts: 270
Joined: Tue Jul 13, 2021 1:53 pm
Has thanked: 41 times
Been thanked: 29 times

Re: SD Card Component

Post by WingNut »

Would this fix potentially speed up writing to sd card with Pic micro?

BenR
Matrix Staff
Posts: 1952
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 510 times
Been thanked: 698 times

Re: SD Card Component

Post by BenR »

WingNut wrote:
Mon Mar 06, 2023 3:15 pm
Would this fix potentially speed up writing to sd card with Pic micro?
Possibly, It certainly shouldn't hurt. Main thing to help get speed with the PIC would be to get the high speed SPI prescaler as low as you can and use a hardware based SPI channel.

WingNut
Posts: 270
Joined: Tue Jul 13, 2021 1:53 pm
Has thanked: 41 times
Been thanked: 29 times

Re: SD Card Component

Post by WingNut »

Must have a play with that later

stefan.erni
Valued Contributor
Posts: 1065
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 201 times
Been thanked: 225 times

Re: SD Card Component

Post by stefan.erni »

Hi Ben

After the lib update with the FAT component I get a problem in compiling

regards

Stefan
Attachments
Fc10_2023_emg_ekg__v_2023_03_02_11-00.msg.txt
(90 KiB) Downloaded 515 times

stefan.erni
Valued Contributor
Posts: 1065
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 201 times
Been thanked: 225 times

Re: SD Card Component

Post by stefan.erni »

Hi Ben

I tested Version 9 from the FAT component and this is working fine (version10 not)

I will still measure the improvement of the speed in the laboratory

regards
Stefan


6 Channel of 8Channel, 24bit, 80hz Signal sampled with PIC32 and saved to micro SD card
Snag_b8e698.png
Snag_b8e698.png (117.95 KiB) Viewed 4188 times

BenR
Matrix Staff
Posts: 1952
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 510 times
Been thanked: 698 times

Re: SD Card Component

Post by BenR »

Hello,
After the lib update with the FAT component I get a problem in compiling
Hopefully solved for you now.

stefan.erni
Valued Contributor
Posts: 1065
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 201 times
Been thanked: 225 times

Re: SD Card Component

Post by stefan.erni »

Hi Ben

Yes it's fine now with the FAT component.

I tested this new version12
and the 80Hz signal sampled with 2kHz looks good even in the spectrum.

regards

Stefan
Attachments
Snag_10b855.png
Snag_10b855.png (57.3 KiB) Viewed 4174 times

Post Reply