• PicŪ Basic


  • Proton24 SD FAT File System

    The Proton24 File System library accesses an SD card formatted with FAT16 or FAT32. The library will auto detect the FAT type.

    The SD card's attachment to the microcontroller must be configured for the SPI interface to operate correctly. This is accomplished by preprocessor $define directives:

    * SD_CLK defines where the SD card's CLK pin will attach.
    * SD_SDO defines where the SD card's DI pin will attach.
    * SD_SDI defines where the SD card's DO pin will attach.
    * SD_CS defines where the SD card's CS pin will attach.
    * SD_Power is an optional define that will power cycle the pin prior to initialising the SD card. It may be connected to a MOSFET driving the SD card's VDD pin.

    In order to use the library, include it at the top of the program, but below the $defines:

    Code:
       Device = 24HJ128GP502
      Declare Xtal = 79.23
    
      $define SD_CLK PORTB.7    ' SPI CLK to SD card's CLK pin
      $define SD_SDO PORTB.8    ' SPI DO to SD card's DI pin
      $define SD_SDI PORTB.9    ' SPI DI to SD card's DO pin
      $define SD_CS PORTB.10    ' SPI CS to SD card's CS pin (active low)
      $define SD_Power PORTA.3  ' Enable/Disable the SD card's VDD (active low)
    
      Include "FileSys24.inc"   ' Load the FAT file system procedures into the program
    A suitable circuit for the attachment of an SD card to a PIC24 microcontroller is shown below:


    Below is a list of available procedures and defines:

    File_Init
    Initialise the SD card and FAT file system.

    Proc File_Init(), Byte

    Will return one of the following values:
    cErrOK
    cErrNoResponse
    cErrInvalidFormat
    cErrRWError

    Code:
         Device = 24HJ128GP502
        Declare Xtal = 79.23
        Declare Hserial_Baud = 38400
        Declare Hrsout1_Pin = PORTB.3 ' Select which pin is to be used for TX with USART1
    '
    ' SD Card SPI pin definitions
    '
        $define SD_CLK PORTB.7    ' SPI CLK to SD card's CLK pin
        $define SD_SDO PORTB.8    ' SPI DO to SD card's DI pin
        $define SD_SDI PORTB.9    ' SPI DI to SD card's DO pin
        $define SD_CS PORTB.10    ' SPI CS to SD card's CS pin (active low)
        $define SD_Power PORTA.3  ' Enable/Disable the SD card's VDD (active low)
    
        Include "FileSys24.inc"   ' Load the FAT file system procedures into the program
    
    '----------------------------------------------------------------------------------------
    Main:
        PLL_Setup(43, 2, 2, $0300)                     ' Configure the Oscillator to operate at 79.23MHz
        PPS_Output(cOut_Pin_RP3, cOut_Fn_U1TX)        ' Make Pin RB3 U1TX
    
        If FAT_Init() = cErrOK Then                   ' Can we initialise the FAT?
            HRSOut "SD initialised\r"                 ' Yes. So transmit a message
        Else                                          ' Otherwise...
            HRSOut "Cannot initialise SD\r"           ' Transmit an error message
        EndIf
    
    '----------------------------------------------------------------------------------------
    ' Configure for internal 7.37MHz oscillator with PLL
    ' OSC pins are general purpose I/O
    '
        Config FBS = BWRP_WRPROTECT_OFF, BSS_NO_FLASH, BSS_NO_BOOT_CODE
        Config FSS = SWRP_WRPROTECT_OFF, SSS_NO_FLASH, RSS_NO_SEC_RAM
        Config FGS = GWRP_OFF, GCP_OFF
        Config FOSCSEL = FNOSC_FRCPLL, IESO_OFF
        Config FOSC = POSCMD_NONE, OSCIOFNC_ON, IOL1WAY_OFF, FCKSM_CSDCMD
        Config FWDT = WDTPOST_PS256, WINDIS_OFF, FWDTEN_OFF
        Config FPOR = FPWRT_PWR128, ALTI2C_OFF
        Config FICD = ICS_PGD1, JTAGEN_OFF
    File_DirExists
    Check if a directory exists.

    Proc File_DirExists(pDir As String * 11), Bit

    pDir - Holds the 8 character directory name. i.e. Dir1.
    Returns true if a directory exists, false otherwise.

    File_ChDir
    Change the directory.

    Proc ChDir(pDir As String * 11), Bit

    pDir - Holds the 8 character directory name. i.e. Dir1.
    Returns true if success, false otherwise.

    File_RmDir
    Remove an existring directory.

    Proc File_RmDir(pDir As String * 11) As Byte

    pDir - Holds the 8 character directory name. i.e. Dir1.

    Will return one of the following values:
    cErrOK
    cErrNotFound
    cErrDirNotEmpty
    cErrRWError

    File_MkDir
    Make a new directory.

    Proc File_MkDir(pDir As String * 11), Byte

    pDir - Holds the 8 character directory name. i.e. Dir1.

    Will return one of the following values:
    cErrOK
    cErrExists
    cErrDiskFull
    cErrRootDirFull
    cErrInUse
    cErrRWError

    File_FileExists
    Check if a file exists.

    Proc File_FileExists(pFilename As String * 11), Bit

    pFilename - Holds the 8 character file name and 3 character extension. i.e. file1.txt.

    Returns true if found, false otherwise.

    File_Open
    Opens a file for reading or writing.

    Proc File_Open(pFilename As String * 11), Byte

    pFilename - Holds the 8 character file name and 3 character extension. i.e. file1.txt.

    Will return one of the following values:
    cErrOK
    cErrNotFound
    cErrInUse
    cErrRWError

    File_Close
    Close a file previously opended with File_Open

    Proc File_Close()

    File_Create
    Create a new file on disk and open it.

    Proc File_Create(pFilename As String * 11) As Byte

    pFilename - Holds the 8 character file name and 3 character extension. i.e. file1.txt.

    Will return one of the following values:
    cErrOK
    cErrExists
    cErrDiskFull
    cErrRootDirFull
    cErrInUse
    cErrRWError

    Code:
         Device = 24HJ128GP502
        Declare Xtal = 79.23
        Declare Hserial_Baud = 38400
        Declare Hrsout1_Pin = PORTB.3 ' Select which pin is to be used for TX with USART1
    '
    ' SD Card SPI pin definitions
    '
        $define SD_CLK PORTB.7    ' SPI CLK to SD card's CLK pin
        $define SD_SDO PORTB.8    ' SPI DO to SD card's DI pin
        $define SD_SDI PORTB.9    ' SPI DI to SD card's DO pin
        $define SD_CS PORTB.10    ' SPI CS to SD card's CS pin (active low)
        $define SD_Power PORTA.3  ' Enable/Disable the SD card's VDD (active low)
    
        Include "FileSys24.inc"   ' Load the FAT file system procedures into the program
    
        Dim MyFileName As String * 11  
    
    '----------------------------------------------------------------------------------------
    ' Transmit the disk directory to a serial terminal
    '
    Proc DirListing()
        Dim FileDirName As String * 11
        While
            FileDirName = File_GetDir()                 ' Look for directories
            If FileDirName_0 = 0 Then
                While
                   FileDirName = File_GetFile()         ' Then look for files
                   If FileDirName_0 = 0 Then Return
                   HRSOut FileDirName, " : ", Dec File_dSize, " bytes\r"
                Wend
            EndIf
            HRSOut FileDirName, 13
        Wend
    EndProc
    '----------------------------------------------------------------------------------------
    Main:  
         PLL_Setup(43, 2, 2, $0300)                               ' Configure the Oscillator to operate at 79.23MHz
        PPS_Output(cOut_Pin_RP3, cOut_Fn_U1TX)                  ' Make Pin RB3 U1TX    
    
        MyFileName = "File1.txt"
        
        If FAT_Init() = cErrOK Then                             ' Can we initialise the FAT?     
            DirListing()                                        ' Yes. So transmit the directory listing  
            If File_Exists(MyFileName) = False Then             ' Does the file already exist?
                If File_Create(MyFileName) = cErrOK Then        ' No. So could we create it?
                    HRSOut "File ", MyFileName, " Created\r"    ' Yes. So transmit a message
                    File_Close()                                ' Close the file
                    DirListing()                                ' Transmit the directory
                Else                                            ' Otherwise...
                    HRSOut "File Not Created\r"                 ' Transmit an error response
                EndIf
            Else                                                ' Otherwise...
                HRSOut MyFileName, " Already exists\r"          ' Transmit an error response
            EndIf
        Else                                                    ' Otherwise...
            HRSOut "Cannot initialise SD\r"                     ' Transmit an error response
        EndIf
        
    '----------------------------------------------------------------------------------------
    ' Configure for internal 7.37MHz oscillator with PLL
    ' OSC pins are general purpose I/O
    '
        Config FBS = BWRP_WRPROTECT_OFF, BSS_NO_FLASH, BSS_NO_BOOT_CODE
        Config FSS = SWRP_WRPROTECT_OFF, SSS_NO_FLASH, RSS_NO_SEC_RAM
        Config FGS = GWRP_OFF, GCP_OFF
        Config FOSCSEL = FNOSC_FRCPLL, IESO_OFF
        Config FOSC = POSCMD_NONE, OSCIOFNC_ON, IOL1WAY_OFF, FCKSM_CSDCMD
        Config FWDT = WDTPOST_PS256, WINDIS_OFF, FWDTEN_OFF
        Config FPOR = FPWRT_PWR128, ALTI2C_OFF
        Config FICD = ICS_PGD1, JTAGEN_OFF
    File_Delete
    Delete an existing file.

    Proc File_Delete(pFilename As String * 11), Bit

    pFilename - Holds the 8 character file name and 3 character extension. i.e. file1.txt.

    Returns true if file deleted, false otherwise.

    File_Append
    Open an existing file for writing to end of file.

    Proc File_Append(pFilename As String * 11), Byte

    pFilename - Holds the 8 character file name and 3 character extension. i.e. file1.txt.

    Will return one of the following values:
    cErrOK
    cErrNotFound
    cErrDiskFull
    cErrRootDirFull
    cErrInUse
    cErrRWError

    Code:
         Device = 24HJ128GP502
        Declare Xtal = 79.23
        Declare Hserial_Baud = 38400
        Declare Hrsout1_Pin = PORTB.3 ' Select which pin is to be used for TX with USART1
    '
    ' SD Card SPI pin definitions
    '
        $define SD_CLK PORTB.7    ' SPI CLK to SD card's CLK pin
        $define SD_SDO PORTB.8    ' SPI DO to SD card's DI pin
        $define SD_SDI PORTB.9    ' SPI DI to SD card's DO pin
        $define SD_CS PORTB.10    ' SPI CS to SD card's CS pin (active low)
        $define SD_Power PORTA.3  ' Enable/Disable the SD card's VDD (active low)
    
        Include "FileSys24.inc"   ' Load the FAT file system procedures into the program
    
        Dim MyFileName As String * 11
        Dim MyWord As Word
        Dim MyFloat As Float
        Dim MyDouble As Double
    
    '----------------------------------------------------------------------------------------
    Main:    
         PLL_Setup(43, 2, 2, $0300)                               ' Configure the Oscillator to operate at 79.23MHz
        PPS_Output(cOut_Pin_RP3, cOut_Fn_U1TX)                  ' Make Pin RB3 U1TX 
        
        MyFileName = "File1.txt"
        
        If FAT_Init() = cErrOK Then                             ' Can we initialise the FAT?     
            If File_Exists(MyFileName) = False Then             ' Does the file already exist?           
                File_Create(MyFileName)                         ' No. So create it            
                File_Close()                                    ' Then close it
            EndIf
             
            If File_Append(MyFileName) = cErrOK Then            ' Can we append to an existing file?
                HRSOut "Writing\r"                              ' Yes. So transmit a message
                File_Write "Integer Data\r"
                For MyWord = 0 To 200                           ' \
                    File_Write Dec MyWord, ", "                 ' | Write ASCII data to the file
                Next                                            ' /
                File_Write "\rFloat Data\r"
                For MyFloat = 0 To 9 Step 0.5                   ' \
                    File_Write Dec MyFloat, ", "                ' | Write ASCII data to the file
                Next                                            ' /
                File_Write "\rDouble Data\r"
                For MyDouble = 0 To 9 Step 0.5                  ' \
                    File_Write Dec MyDouble, ", "               ' | Write ASCII data to the file
                Next                                            ' /
                File_Write 13
                File_Close()                                     ' Close the file
                HRSOut "Finished Writing\r"
            Else
                HRSOut "Cannot append ", MyFileName, 13  
            EndIf
        Else                                                    ' Otherwise...
            HRSOut "Cannot initialise SD\r"                     ' Transmit an error response
        EndIf
        
    '----------------------------------------------------------------------------------------
    ' Configure for internal 7.37MHz oscillator with PLL
    ' OSC pins are general purpose I/O
    '
        Config FBS = BWRP_WRPROTECT_OFF, BSS_NO_FLASH, BSS_NO_BOOT_CODE
        Config FSS = SWRP_WRPROTECT_OFF, SSS_NO_FLASH, RSS_NO_SEC_RAM
        Config FGS = GWRP_OFF, GCP_OFF
        Config FOSCSEL = FNOSC_FRCPLL, IESO_OFF
        Config FOSC = POSCMD_NONE, OSCIOFNC_ON, IOL1WAY_OFF, FCKSM_CSDCMD
        Config FWDT = WDTPOST_PS256, WINDIS_OFF, FWDTEN_OFF
        Config FPOR = FPWRT_PWR128, ALTI2C_OFF
        Config FICD = ICS_PGD1, JTAGEN_OFF
    File_Rename
    Rename a file.

    Proc File_Rename(pOldFilename As String * 11, pNewFilename As String * 11), Byte

    pOldfilename - Holds the 8 character file name and 3 character extension of the file to rename
    pNewfilename - Holds the 8 character file name and 3 character extension of the new file name

    Will return one of the following values:
    cErrOK
    cErrExists
    cErrNotFound
    cErrRWError

    Code:
         Device = 24HJ128GP502
        Declare Xtal = 79.23
        
        Declare Hserial_Baud = 38400
        Declare Hrsout1_Pin = PORTB.3 ' Select which pin is to be used for TX with USART1
    '
    ' SD Card SPI pin definitions
    '
        $define SD_CLK PORTB.7    ' SPI CLK to SD card's CLK pin
        $define SD_SDO PORTB.8    ' SPI DO to SD card's DI pin
        $define SD_SDI PORTB.9    ' SPI DI to SD card's DO pin
        $define SD_CS PORTB.10    ' SPI CS to SD card's CS pin (active low)
        $define SD_Power PORTA.3  ' Enable/Disable the SD card's VDD (active low)
    
        Include "FileSys24.inc"   ' Load the FAT file system procedures into the program
    
        Dim MyFileName As String * 11
      
    '----------------------------------------------------------------------------------------
    ' Transmit the disk directory to a serial terminal
    '
    Proc DirListing()
        Dim FileDirName As String * 11
        While
            FileDirName = File_GetDir()                 ' Look for directories
            If FileDirName_0 = 0 Then
                While
                   FileDirName = File_GetFile()         ' Then look for files
                   If FileDirName_0 = 0 Then Return
                   HRSOut FileDirName, " : ", Dec File_dSize, " bytes\r"
                Wend
            EndIf
            HRSOut FileDirName, 13
        Wend
    EndProc
    '----------------------------------------------------------------------------------------
    Main:   
         PLL_Setup(43, 2, 2, $0300)                               ' Configure the Oscillator to operate at 79.23MHz
        PPS_Output(cOut_Pin_RP3, cOut_Fn_U1TX)                  ' Make Pin RB3 U1TX 
        
        MyFileName = "file2.txt"
        
        If FAT_Init() = cErrOK Then                             ' Can we initialise the FAT?     
            DirListing()                                        ' Yes. So transmit the directory      
            If File_Exists(MyFileName) = True Then              ' Does the file exist?
                If File_Rename("file2.txt", "file3.txt") = cErrOK Then ' Yes. So could we rename it?
                    HRSOut  "File Renamed\r"                  ' Yes. So transmit a message
                    DirListing()                                ' Transmit the directory
                Else                                            ' Otherwise...
                    HRSOut  "File Not Renamed\r"                ' Transmit an error response
                EndIf
            Else                                                ' Otherwise...
                HRSOut  "Cannot find " , MyFileName, 13          ' Transmit an error response
            EndIf
        Else                                                    ' Otherwise...
            HRSOut  "Cannot initialise SD\r"                     ' Transmit an error response
        EndIf
        
    '----------------------------------------------------------------------------------------
    ' Configure for internal 7.37MHz oscillator with PLL
    ' OSC pins are general purpose I/O
    '
        Config FBS = BWRP_WRPROTECT_OFF, BSS_NO_FLASH, BSS_NO_BOOT_CODE
        Config FSS = SWRP_WRPROTECT_OFF, SSS_NO_FLASH, RSS_NO_SEC_RAM
        Config FGS = GWRP_OFF, GCP_OFF
        Config FOSCSEL = FNOSC_FRCPLL, IESO_OFF
        Config FOSC = POSCMD_NONE, OSCIOFNC_ON, IOL1WAY_OFF, FCKSM_CSDCMD
        Config FWDT = WDTPOST_PS256, WINDIS_OFF, FWDTEN_OFF
        Config FPOR = FPWRT_PWR128, ALTI2C_OFF
        Config FICD = ICS_PGD1, JTAGEN_OFF
    File_Position
    Returns the current file position, in bytes.

    Proc File_Position(), Dword

    File_EOF
    Returns true if a file opened for reading has reached the end of file, false otherwise.

    Proc File_EOF() As Bit

    File_IsFull
    Returns true if the SD card is full, otherwise, false.

    $define File_IsFull()

    File_Seek
    Seek a position within an open file.

    Proc File_Seek(pPosition As Dword), Byte

    pPosition - File position to locate.

    Will return one of the following values:
    cErrOK
    cErrRWError
    cErrFileNotOpen
    cErrBeyondEOF

    File_Size
    Returns the size of an open file, in bytes.

    $define File_Size()

    File_GetDir
    Read a directory name.

    Proc File_GetDir(), String *11

    If the directory is not found, an empty string is returned. Note that the string will be padded to 8:3 format with spaces.

    File_GetFile
    Read a file name.

    Proc File_GetFile(), String *11

    If the directory is not found, an empty string is returned. Note that the string will be padded to 8:3 format with spaces.

    Disk Directory and File Listing Example.
    Code:
         Device = 24HJ128GP502
        Declare Xtal = 79.23
        Declare Hserial_Baud = 38400
        Declare Hrsout1_Pin = PORTB.3 ' Select which pin is to be used for TX with USART1
    '
    ' SD Card SPI pin definitions
    '
        $define SD_CLK PORTB.7    ' SPI CLK to SD card's CLK pin
        $define SD_SDO PORTB.8    ' SPI DO to SD card's DI pin
        $define SD_SDI PORTB.9    ' SPI DI to SD card's DO pin
        $define SD_CS PORTB.10    ' SPI CS to SD card's CS pin (active low)
        $define SD_Power PORTA.3  ' Enable/Disable the SD card's VDD (active low)
    
        Include "FileSys24.inc"   ' Load the FAT file system procedures into the program
    
    '----------------------------------------------------------------------------------------
    ' Transmit the disk directory to a serial terminal
    '
    Proc DirListing()
        Dim FileDirName As String * 11
        While
            FileDirName = File_GetDir()              ' Look for directories
            If FileDirName_0 = 0 Then
                While
                   FileDirName = File_GetFile()      ' Then look for files
                   If FileDirName_0 = 0 Then Return
                   HRSOut FileDirName, " : ", Dec File_dSize, " bytes\r"
                Wend
            EndIf
            HRSOut FileDirName, 13
        Wend
    EndProc
    '----------------------------------------------------------------------------------------
    Main:
        PLL_Setup(43, 2, 2, $0300)                     ' Configure the Oscillator to operate at 79.23MHz
        PPS_Output(cOut_Pin_RP3, cOut_Fn_U1TX)        ' Make Pin RB3 U1TX
    
        If FAT_Init() = cErrOK Then                   ' Can we initialise the FAT?
            DirListing()                              ' Yes. So transmit the directory
        Else                                          ' Otherwise...
            HRSOut "Cannot initialise SD\r"           ' Transmit an error message
        EndIf
    
    '----------------------------------------------------------------------------------------
    ' Configure for internal 7.37MHz oscillator with PLL
    ' OSC pins are general purpose I/O
    '
        Config FBS = BWRP_WRPROTECT_OFF, BSS_NO_FLASH, BSS_NO_BOOT_CODE
        Config FSS = SWRP_WRPROTECT_OFF, SSS_NO_FLASH, RSS_NO_SEC_RAM
        Config FGS = GWRP_OFF, GCP_OFF
        Config FOSCSEL = FNOSC_FRCPLL, IESO_OFF
        Config FOSC = POSCMD_NONE, OSCIOFNC_ON, IOL1WAY_OFF, FCKSM_CSDCMD
        Config FWDT = WDTPOST_PS256, WINDIS_OFF, FWDTEN_OFF
        Config FPOR = FPWRT_PWR128, ALTI2C_OFF
        Config FICD = ICS_PGD1, JTAGEN_OFF
    File_Write
    Write a single or multiple variable types to an open file.

    File_Write follows the same rules as Print and Hrsout, in that it can contain variables and/or modifiers that are comma delimited:

    File_Write "Hello World ", Dec MyByte, " ", Hex MyWord, " ", Dec MyFloat, 13

    File_Read
    Read a single or multiple variable types from an open file.

    File_read follows the same rules as Hrsin, in that it can contain variables and/or modifiers that are comma delimited:

    File_Read MyByte, MyWord, MyFloat

    or

    MyFloat = File_Read

    Code:
          Device = 24HJ128GP502
        Declare Xtal = 79.23
        Declare Hserial_Baud = 38400
        Declare Hrsout1_Pin = PORTB.3 ' Select which pin is to be used for TX with USART1
    '
    ' SD Card SPI pin definitions
    '
        $define SD_CLK PORTB.7    ' SPI CLK to SD card's CLK pin
        $define SD_SDO PORTB.8    ' SPI DO to SD card's DI pin
        $define SD_SDI PORTB.9    ' SPI DI to SD card's DO pin
        $define SD_CS PORTB.10    ' SPI CS to SD card's CS pin (active low)
        $define SD_Power PORTA.3  ' Enable/Disable the SD card's VDD (active low)
    
        Include "FileSys24.inc"   ' Load the FAT file system procedures into the program
    
        Dim MyFileName As String * 11
        Dim MyWord As Word
        Dim MyChar As Byte
    
    '----------------------------------------------------------------------------------------
    Main:
         PLL_Setup(43, 2, 2, $0300)                               ' Configure the Oscillator to operate at 79.23MHz
        PPS_Output(cOut_Pin_RP3, cOut_Fn_U1TX)                  ' Make Pin RB3 U1TX
        
        MyFileName = "File1.txt"
        
        If FAT_Init() = cErrOK Then                             ' Can we initialise the FAT?     
            If File_Exists(MyFileName) = False Then             ' Does the file already exist?           
                File_Create(MyFileName)                         ' No. So create it            
                File_Close()                                    ' Then close it
            EndIf
             
            If File_Append(MyFileName) = cErrOK Then            ' Can we append to an existing file?
                HRSOut "Writing\r"                              ' Yes. So transmit a message
                '
                ' Write to the file
                '
                File_Write "Integer Data\r"
                For MyWord = 0 To 200                           ' \
                    File_Write Dec MyWord, ", "                 ' | Write ASCII data to the file
                Next                                            ' /
                File_Write 13
                File_Close()                                    ' Close the file
                '
                ' Read from the file
                '
                HRSOut "Reading File\r"
                If File_Open(MyFileName) = cErrOK Then          ' Can we open the file?
                    While File_tEOF = False                     ' Yes. So read until the fil eis finished
                        MyChar = File_Read                      ' Read from the file
                        HRSOut MyChar                           ' Transmit what was read from the file
                    Wend
                    File_Close()                                ' Close the file
                Else                                             ' Otherwise...
                    HRSOut "Cannot open ", MyFileName, 13       ' Transmit an error response
                EndIf
            Else
                HRSOut "Cannot append ", MyFileName, 13  
            EndIf
        Else                                                    ' Otherwise...
            HRSOut "Cannot initialise SD\r"                     ' Transmit an error response
        EndIf
        
    '----------------------------------------------------------------------------------------
    ' Configure for internal 7.37MHz oscillator with PLL
    ' OSC pins are general purpose I/O
    '
        Config FBS = BWRP_WRPROTECT_OFF, BSS_NO_FLASH, BSS_NO_BOOT_CODE
        Config FSS = SWRP_WRPROTECT_OFF, SSS_NO_FLASH, RSS_NO_SEC_RAM
        Config FGS = GWRP_OFF, GCP_OFF
        Config FOSCSEL = FNOSC_FRCPLL, IESO_OFF
        Config FOSC = POSCMD_NONE, OSCIOFNC_ON, IOL1WAY_OFF, FCKSM_CSDCMD
        Config FWDT = WDTPOST_PS256, WINDIS_OFF, FWDTEN_OFF
        Config FPOR = FPWRT_PWR128, ALTI2C_OFF
        Config FICD = ICS_PGD1, JTAGEN_OFF
    The Proton24 FAT File library is installed with version 1.0.1.2 of the free Proton24 compiler, which is itself installed with the full version of the Proton compiler version 3.5.6.2.
    Example programs can be found within the compiler's Samples24 folder. The FileSys24.inc file can be found in the user's Includes folder.
  • Recent Activity

    See_Mos-247

    Mysterious PORTB problem

    Thread Starter: xldaedalus

    I'm using Proton+ to develop firmware for a product with switches. The MCU is an 18F26K22. Most of the switches reside on PORTB. I am NOT using a...

    See_Mos Today, 10:14 Go to last post
    Stephen Moss-711

    Watchdog timer

    Thread Starter: joesaliba

    I have a code that basically looks for four input and four outputs, depends on various timing and input conditions. I use interrupt and some delays...

    Stephen Moss Today, 10:15 Go to last post