SD Card with PIC18f4620 and display data on Nokia 6100 LCD
0
Nokia 6100 LCD is a low cost display component :D (in my hometown, its prise is just 1$)
So I have tried and programed successfully to display the data to this LCD, it is great revese engineering!
(I will write another post about this LCD later)
(English is not my strong language, if I have any mistake about grammar or spelling... please let me know or correct it, it'll help me a lot, thanks you!)
I am going to make a mp3 player, then I also have to program sd card and display to this LCD, and I have had some good results.
In this project, I use PIC18F4620 and run it at 48MHz (12MHz crystal and x4 PLL = 48MHz) for all operating tasks, I use my own lib for nokia 6100 lcd (use software SPI), and use MDD Microchip Library to control SD Card ( I think this library is so good,except the problem is that it generates so much code for sdcard library, program memory spacae of this PIC is not enough for sdcard code, I had to enable optimize feature of C18 to compile the code successfully after solve a lot of error :3)
Below is the schematic of SD Card module(click to view large image):
PIC interfaces with SD Card via SPI1 module and the pin connection is shown below:
SD Card PIC (PORT C)
SDO C5
SDI C4
SCK C3
CS C1
I use some function of MDD Library in Microchip Application Library (you can find and download it at Microchip website)
Below is some functions which use to support SD Card operation:
(see more details in Implementing File I/O Functions Using Microchips Memory
Disk Drive File System Library of Microchip)
int FSInit(void)
int FSfclose( FSFILE *stream )
int FSfeof( FSFILE *stream ):
FSFILE * FSfopen ( const char * fileName, const char *mode )
FSFILE * FSfopenpgm (const rom char * fileName, const rom char *mode)
size_t FSfread( void *ptr, size_t size, size_t n, FSFILE *stream )
int FSfseek( FSFILE *stream, long offset, int whence )
long FSftell( FSFILE *stream )
size_t FSfwrite( const void *ptr, size_t size, size_t n, FSFILE *stream )
int FSremove (const char * filename)
int FSremove (const rom char * filename)
void FSrewind (FSFILE *stream)
int SetClockVars (unsigned int year, unsigned char month, unsigned char day,
unsigned char hour, unsigned char minute, unsigned char second);
int FSformat (char mode, long int serialNumber, char * volumeID);
int FSmkdir (char * path);
int FSchdir (char * path);
int FSrmdir (char * path, unsigned char rmsubdirs);
char * FSgetcwd (char * path, int numchars);
int FindFirst (const char * fileName, unsigned int attr, SearchRec * rec);
int FindFirstpgm (const rom char * fileName, unsigned int attr, SearchRec * rec);
int FindNext (SearchRec * rec);
int FSrename (const char *fileName, FSFILE * fo)
int FSfprintf (FSFILE *fptr, const char * fmt, ...)
(to be continoued)
So I have tried and programed successfully to display the data to this LCD, it is great revese engineering!
(I will write another post about this LCD later)
(English is not my strong language, if I have any mistake about grammar or spelling... please let me know or correct it, it'll help me a lot, thanks you!)
I am going to make a mp3 player, then I also have to program sd card and display to this LCD, and I have had some good results.
In this project, I use PIC18F4620 and run it at 48MHz (12MHz crystal and x4 PLL = 48MHz) for all operating tasks, I use my own lib for nokia 6100 lcd (use software SPI), and use MDD Microchip Library to control SD Card ( I think this library is so good,except the problem is that it generates so much code for sdcard library, program memory spacae of this PIC is not enough for sdcard code, I had to enable optimize feature of C18 to compile the code successfully after solve a lot of error :3)
Below is the schematic of SD Card module(click to view large image):
PIC interfaces with SD Card via SPI1 module and the pin connection is shown below:
SD Card PIC (PORT C)
SDO C5
SDI C4
SCK C3
CS C1
I use some function of MDD Library in Microchip Application Library (you can find and download it at Microchip website)
Below is some functions which use to support SD Card operation:
(see more details in Implementing File I/O Functions Using Microchips Memory
Disk Drive File System Library of Microchip)
int FSInit(void)
int FSfclose( FSFILE *stream )
int FSfeof( FSFILE *stream ):
FSFILE * FSfopen ( const char * fileName, const char *mode )
FSFILE * FSfopenpgm (const rom char * fileName, const rom char *mode)
size_t FSfread( void *ptr, size_t size, size_t n, FSFILE *stream )
int FSfseek( FSFILE *stream, long offset, int whence )
long FSftell( FSFILE *stream )
size_t FSfwrite( const void *ptr, size_t size, size_t n, FSFILE *stream )
int FSremove (const char * filename)
int FSremove (const rom char * filename)
void FSrewind (FSFILE *stream)
int SetClockVars (unsigned int year, unsigned char month, unsigned char day,
unsigned char hour, unsigned char minute, unsigned char second);
int FSformat (char mode, long int serialNumber, char * volumeID);
int FSmkdir (char * path);
int FSchdir (char * path);
int FSrmdir (char * path, unsigned char rmsubdirs);
char * FSgetcwd (char * path, int numchars);
int FindFirst (const char * fileName, unsigned int attr, SearchRec * rec);
int FindFirstpgm (const rom char * fileName, unsigned int attr, SearchRec * rec);
int FindNext (SearchRec * rec);
int FSrename (const char *fileName, FSFILE * fo)
int FSfprintf (FSFILE *fptr, const char * fmt, ...)
(to be continoued)