The Micro SDCard Adapter module that we have considered in our Project is a Micro SDCard Adapter from Catalex. I purchased it from Amazon, from the link below:
|Micro SDCard Adapter, from Catalex|
|Schematic of the MicroSD Card Adapter.|
|Adding the connections between our RaspberryPi and Micro SDCard Module.|
The following GPIO pins were used from the P1 Expansion Header of RaspberryPi, Model B, Rev 2:
GPIO P1. 26 AS OUTPUT_PIN AS Chip Select signal.
GPIO P1. 23 AS OUTPUT_PIN AS Serial CLK signal.
GPIO P1. 21 AS INPUT_PIN AS MISO signal.
GPIO P1. 19 AS OUTPUT_PIN AS MOSI signal
The steps followed for the Installation of BCM2835 Library on RaspberryPi are as follows:
# download the latest version of the library, say bcm2835-1.xx.tar.gz, then:
tar zxvf bcm2835-1.xx.tar.gz
sudo make check
sudo make install
This will install the bcm2835 library to "/usr/local/lib", by default, or user can indicate his preference using -PREFIX Option.
Elm-Chan FATFilesystem Module.
For more Info, people can refer to the Webpage of the FatFs Module, here:
Also, people, can download the Complete zip of the FatFs Filesystem module, incase they want to consider it for other platforms, specific to AVR, ATMEGA et al.
|Handle and Change the generic code for custom platforms.|
So, here is the code that we have added in the file, "mmcbb.c", which we have added specifically for RaspberryPi platform.
|Changes required to adapt the generic code for RaspberryPi.|
Thus, we can view, the complete Architecture as follows:
|Architecture of the Implementation.|
Here, we have shared the complete source of the zip, along with the Makefile, which we are currently running on RaspberryPi.
In, the next concluding sections we will see, about the Test file and Makefile created for the Project.
Test and Makefile.
|Test program in main.c to Write and Log data to the SDCard.|
|Makefile for our Project.|
After making these changes, and installing the appropriate library successfully, open the "TERMINAL" and we execute the Makefile.
since, the TARGET Name in the Makefile is library at line number 22. This will generate the Binary executable, "RpiSDCard". To, execute it, just run on the Terminal by typing,
Results, observations and inferences.
Here is my circuit, which is connected to the MicroSD Adapter Module, as shown below:
|SDCard Logger interfaced with P1 Expansion Header of RaspberryPi.|
On, executing the program, we get the following output on the Terminal, as shown below:
|Output of our Test Program, "main.c".|
So, this completes our Project. Comments and questionnaire can be added in the comments section below, which is open to all. This is an Open Source Initiative.
Here is a small video of the same: