karan123
Member level 3
Hello,
I am using MDD Library for PIC24F interfacing with SD CARD 2GB ScanDisk.
I have not required any file system (like FAT).
So I have filtered out Simple MDD routine for using SDCARD as simple Memory as below:
char sendBuffer[] = "CHECK";
char sendBuffer1[] = "123456";
char recbuffer1[6];
char sendBuffer2[] = "ABCDEF";
char recbuffer2[6];
char send2[] = "2";
char receiveBuffer[50];
while (!MDD_MediaDetect());
MDD_InitIO(); // For Intilize Only Low Level Routine without FAT
MDD_SDSPI_InitIO();
MDD_SDSPI_MediaInitialize();
MDD_SDSPI_SectorWrite(0,(BYTE*)sendBuffer1,TRUE);
MDD_SDSPI_SectorRead(0,(BYTE*)recbuffer1);
UART2PrintString(recbuffer1);
MDD_SDSPI_SectorWrite(10,(BYTE*)sendBuffer2,TRUE);
MDD_SDSPI_SectorRead(10,(BYTE*)recbuffer2);
UART2PrintString(recbuffer2);
Nop();
Nop();
//---------------------------------------
t's Good that I can Write and Read sector (only one sector either 0 or 10) alternatively
by putting comment in program,.
But I can't read two sectors one by one in same program
Or You can say Write/Read multiple blocks to SD card
Any Suggestion For That?
i m testing on PC Hyper terminal ??
--
KR
I am using MDD Library for PIC24F interfacing with SD CARD 2GB ScanDisk.
I have not required any file system (like FAT).
So I have filtered out Simple MDD routine for using SDCARD as simple Memory as below:
char sendBuffer[] = "CHECK";
char sendBuffer1[] = "123456";
char recbuffer1[6];
char sendBuffer2[] = "ABCDEF";
char recbuffer2[6];
char send2[] = "2";
char receiveBuffer[50];
while (!MDD_MediaDetect());
MDD_InitIO(); // For Intilize Only Low Level Routine without FAT
MDD_SDSPI_InitIO();
MDD_SDSPI_MediaInitialize();
MDD_SDSPI_SectorWrite(0,(BYTE*)sendBuffer1,TRUE);
MDD_SDSPI_SectorRead(0,(BYTE*)recbuffer1);
UART2PrintString(recbuffer1);
MDD_SDSPI_SectorWrite(10,(BYTE*)sendBuffer2,TRUE);
MDD_SDSPI_SectorRead(10,(BYTE*)recbuffer2);
UART2PrintString(recbuffer2);
Nop();
Nop();
//---------------------------------------
t's Good that I can Write and Read sector (only one sector either 0 or 10) alternatively
by putting comment in program,.
But I can't read two sectors one by one in same program
Or You can say Write/Read multiple blocks to SD card
Any Suggestion For That?
i m testing on PC Hyper terminal ??
--
KR