News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

SD Card Fat16/Fat32

Started by pjdenyer, Jul 12, 2021, 12:58 PM

Previous topic - Next topic

Nickma

Hello Wimax. Thanks for the answer. I will try this option

Wimax

Hello  ;)

I wonder if there is a way to transmit via serial port the list of files stored on the sd not only with name and extension, but also with date and time of creation of the files ?

Wimax

Quote from: Nickma on Aug 07, 2023, 12:45 PMHello Wimax. Thanks for the answer. I will try this option


Hello, recently I discovered a problem that made it impossible to save the date correctly, whereas the time had no problem.
I think I found the bug within the FileSys24 library in procedure "FAT_SetFileTimeModified" where I used the auxiliary variable "PPA" to provide data to "FAT_InsertByteIntoBuffer":


Proc FAT_SetFileTimeModified(pSectorPos As Word)
 '************* ADDED*******************
 '**************************************
    Dim PPA As Byte


    FAT_InsertByteIntoBuffer(pSectorPos, (Global_bSeconds / 2) | (Global_bMinutes << 5))    ' Create time & date - Seconds/Minutes
    Inc pSectorPos
    FAT_InsertByteIntoBuffer(pSectorPos, (Global_bMinutes >> 3) | (Global_bHours << 3))     ' Create time & date - Minutes/Hours
    Inc pSectorPos
    PPA = Global_bDay | (Global_bMonth << 5)
    FAT_InsertByteIntoBuffer(pSectorPos, PPA )                                              ' Create time & date - Day/Month
   'FAT_InsertByteIntoBuffer(pSectorPos, Global_bDay | (Global_bMonth << 5))                ' Create time & date - Day/Month
    Inc pSectorPos
    PPA =(Global_bMonth >> 3) | ((Global_bYear + 20) << 1)
    FAT_InsertByteIntoBuffer(pSectorPos, PPA ) ' Create time & date - Month/Year
   'FAT_InsertByteIntoBuffer(pSectorPos, (Global_bMonth >> 3) | ((Global_bYear + 20) << 1)) ' Create time & date - Month/Year
EndProc


EndProc

Now it seems ok !

Nickma