TOP Contributors

  1. MIKROE (2752 codes)
  2. Alcides Ramos (372 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (139067 times)
  2. FAT32 Library (71594 times)
  3. Network Ethernet Library (56989 times)
  4. USB Device Library (47330 times)
  5. Network WiFi Library (43006 times)
  6. FT800 Library (42297 times)
  7. GSM click (29777 times)
  8. mikroSDK (27874 times)
  9. PID Library (26858 times)
  10. microSD click (26129 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
Library

RMMC_FAT , RMMC

Rating:

5

Author: Rares Dorin Porutiu

Last Updated: 2016-02-25

Package Version: 1.0.0.3

Category: Storage

Downloaded: 1380 times

Followed by: 2 users

License: MIT license  

Replacements for the libraries MMCFAT16 and MMC included in Mikropascal fo PIC 5.61
This is a BETA TEST version, please report your results - see blog
Advantages :
RMMC : SPI direct, faster approach (currently compiled for SPI1)
RMMC_FAT : FAT16 and FAT32 support, Speed, intelligent read/write cache

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "RMMC_FAT , RMMC" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "RMMC_FAT , RMMC" changes.

Do you want to report abuse regarding "RMMC_FAT , RMMC".

  • Information
  • Comments (1)

Library Blog

Important :

     You can see there is no help or list of declaration for these libraries, because they are INCLUDED in the Mikroe HELP. The same names are used by the MMC and MMC_FAT libraries included in the compiler !!! I changed only in the Directory handling routines the NAME parameters   that were declared as ^byte with var STRING, but it works with the examples in compiler's HELP.

     PLEASE report your results - positive or negative - leaving a comment here or on my email or forum - to help me remove bugs or make it work for your platforms. I keep making new verions whenever bugs are fixed until it works all :) . Thank you !

 

     I am working to boost performance of the microcontrollers.

     I like to work in Mikropascal (PIC and AVR) and I like best the PIC18F97J60 and the ATMEGA644P controllers.

     For PIC I have built a platfom with external 512K of static RAM and I develop without writing the Flash of the chip, that is why you will see an option in the example to compile for external RAM.

     You can delete the all refference to MMC_npower if you don't have a circuit to cut the power to the MMC/SD card. I have implemented a hardware reset in case card does not respond to software reset, just to make sure I can reset the card.

     Also in the example please modify MMC_chip_select and direction to your hardware configuration and select your desired baudrate.

     I wrote some projects and some libraries that fill some gaps in the existing software that I have seen published.

     One by one I will publish them and encourage programmers to test them an report their conclusions and wishes to me, on the forum or on my e-mails.

Published :

RMMC_FAT, RMMC

These are replacements for the libraries MMCFAT16 and MMC included in Mikropascal fo PIC 5.61
They can replace separately each of these libraries or BOTH at once.
Declaration of the exported functions is the same as in the original libraries, except a few necessary modifications that were not consistent with the examples in HELP.
Advantages :
RMMC : SPI direct, faster approach, works only at _SPI_MASTER_OSC_DIV4 after Init
RMMC_FAT : FAT16 and 32 support, Speed, intelligent read/write cache

All my libraries are written so that they don't create the GOTO table in the beginning of the code.

Preparing :

Replacement for Ethernet Internal - application Httpserver with MMC/SD card

Modbus Master-Slave

Serial Buffered Library on Interrupts  with optional 485 control 

 

Considerations while creating the RMMC_FAT:

1. When you write a software for a microcontroller that needs to access a MMC/SD card is inconvenient to limit the card to FAT16 or FAT32 and more practical to support both without adapting procedure names, compiling and flashing the chip in between. So I created routines that can work on both file systems.

2. I experimented with the FAT16 included in the compiler and found out that while reading works decently fast, writing works very slow. So I designed my routines to overcome this situation getting the best I could wthout consuming extra cache memory.

I did the following optimizations :

    Read Cache - a sector that is read or written remains in the buffer and it is not read again if the sector number is identical

    Write Cache - while writing in the same sector, data is written in the buffer, a flag is set that sector has been changed, but no actual writing occurs until flushSector is called. Any read of another sector calls first flushSector and does the actual writing.

    FAT Cache - besides the Read and Write cache in the sectors of the FAT table I have implemented another optimization that I call : Liniar_Clusters_Ahead. Once I have the sector from a FAT table in the buffer, I test if after the cluster that has been requested are any consecutive clusters following, and if there are , I remember it in the OpenedFiles table. Result is that I reduce over 100 times the reading in the cluster area for big files, and can read them very fast. This also applies when writing in an already allocated space.

    These tricks can speed up to 100x times the writing process of a file from 4 bytes chunks, as seen in the example. Take care to set the files of the original library and of the RMMC_FAT to equal sizes , and test them !

ALSO FROM THIS AUTHOR

Usage of ILI9341 SPI with TFT library

1

This is an example on how to connect the cheap module with TFT ILI9341 in SPI mode and SDCard socket created for Arduino. It shows how to modify the TFT routines in TFT_Lib_Defs and what to write in your code to make the whole TFT library work with this module and thus make mikroelektronika compilers support this module, as many customers asked.

[Learn More]