Standalone FatFs example program for PIC32MZ2048EFG100
Have experimented with the FatFs program in this thread, and merged with a tutorial example by Cytron.
FatFs version R0.13c is now used.
For use on PIC32MZ, all dependencies on Plib have been removed.
There are some pieces lifted from Plib, and modified to work without other dependencies.
From the Cytron code, there are some UART routines extracted and put into a separate file.
From the code by Riccardo Leonardi, the millisecond interrupt timer: CoreTimerHandler(),
is also removed from main.c and moved into Ticktimer.c
together with timer initialization and get_fattime() function.
There is also another time service available, using the hardware RTCC
Rtcc_driver.c will pick up __DATE__ and __TIME__ from the operating system when compiled,
and use this for initial time setting.
The board used for testing is a Wi-Fire board from Digilent, with PIC32MZ2048EFG100.
This device do not have a working Secondary crystal Oscillator, and the board have no crystal,
so a Reference Clock divider is used to synthesize 32.768 kHz from the system Primary oscillator signal.
This is routed by PPS to SOSCO pin.
Hardware settings for SD card and SPI interface are in: mmc_spi.h
Other hardware dependent definitions are in: HardwareProfile.h
Configuration bits are moved to separate file: ConfigBits_MZ.c or ConfigBits_MX.c
With PIC32MZ running with 200 MHz system clock, 100 MHz peripheral clock and
SPIBRG = 1, giving 25 MHz SPI clock frequency,
24 MegaByte test is performed in 22949 millisecond, giving 1070 kByte/s.
post edited by Mysil - 2019/02/01 16:46:12