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]
posted on 2012/12/29 03:32:35 PM CET
I want to build a PCB test unit using the Atmel STK500 development module. The PCB is memory mapped to C200H. I can email you the code that I have used so far.
posted on 2012/12/17 04:16:08 PM CET
I need sd-card reader code to integrate into a project. The target is a picmx460f512L, I'm using the MikroC compiler.
Thank you,
Mike
posted on 2012/04/16 10:14:33 AM CEST
Hello,
I need a application sample for 18F4550 for MMC Card Read_Write?
If possible?
posted on 2012/02/29 03:21:15 PM CET
Hello there,
maybe someone can tell me where is my mistake when I calculate free clusters in FAT table.
I have read tons info about FAT16, but anyway something wrong in my code. I compare my results with results giving WinHex or simple Win. So my code :
.........
ptrInt = &DataBuffer[0x0B];
BytesPerSector = *ptrInt;
SectorsPerCluster = DataBuffer[0x0D];
ptrInt = &DataBuffer[0x0E];
ReservedSectors = *ptrInt;
NumberFats = DataBuffer[0x10];
ptrInt = &DataBuffer[0x16];
SectorsPerFat = *ptrInt;
ptrLong = &DataBuffer[0x20];
NumberSectors = *ptrLong;
ptrInt = &DataBuffer[0x1C];
HidenSectors = *ptrInt;
FirstFatSector = HidenSectors + ReservedSectors;
LastFatSector = FirstFatSector + SectorsperFat;
Root_Dir_Start = ReservedSectors + NumberFats * SectorsPerFat;
First_Data_Sector = Root_Dir_Start + 32;
Usable_Clusters = (NumberSectors - (First_Data_Sector + 1)) / SectorsPerCluster; // Total available clusters
Capacity = BytesPerSector * SectorsPerCluster * Usable_Clusters;
there any problems - formulas works great,
but there I'm stuck :
Sector = FirstFatSector;
freeClusters = 0;
while( Sector < LastFatSector )
{
Mmc_Read_Sector(Sector, DataBuffer);
for(i=0; i<256; i++) // i - FAT entries. 256 - in FAT any entry is 2 bytes long, so 512/2 = 256
{
if((DataBuffer [i*2]== 0x00) && (DataBuffer [(i*2)+ 1]== 0x00))
freeClusters++;
}
Sector++;
}
......
result ==> freeClusters = 61450 - a little to big!
but WinHex show me another value - 61243.
So I'll be deeply thankful
posted on 2011/10/21 11:42:04 AM CEST
I need a code to store data in a PIC32 flas memory. Thanks a lot. Regards.