Page 1 of 1

SD Card Component

Posted: Mon Mar 06, 2023 12:36 pm
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.

Re: SD Card Component

Posted: Mon Mar 06, 2023 1:08 pm
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

Re: SD Card Component

Posted: Mon Mar 06, 2023 1:24 pm
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.

Re: SD Card Component

Posted: Mon Mar 06, 2023 3:15 pm
by WingNut
Would this fix potentially speed up writing to sd card with Pic micro?

Re: SD Card Component

Posted: Mon Mar 06, 2023 3:19 pm
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.

Re: SD Card Component

Posted: Mon Mar 06, 2023 3:25 pm
by WingNut
Must have a play with that later

Re: SD Card Component

Posted: Tue Mar 07, 2023 9:51 am
by stefan.erni
Hi Ben

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

regards

Stefan

Re: SD Card Component

Posted: Tue Mar 07, 2023 11:01 am
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 4211 times

Re: SD Card Component

Posted: Tue Mar 07, 2023 11:11 am
by BenR
Hello,
After the lib update with the FAT component I get a problem in compiling
Hopefully solved for you now.

Re: SD Card Component

Posted: Tue Mar 07, 2023 12:54 pm
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