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]

Sort By

USER REQUESTS

first | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 last
Naglis Radavicius
Naglis

posted on 2012/02/29 03:21:15 PM CET

Storage

MMC/SD FAT16 FAT free clusters calculate

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

Arun Sharma
07arunsharma

posted on 2012/02/19 03:22:03 AM CET

Graphics & LCD

LCD Code in 8-Bit Mode for PIC in mikroC for PIC

I am one of the biggest fan of MikroC for PIC.
But i am stuck in a problem..
Due to some reasons i can't use 4-bit mode LCD Code..
And That's why i need 8-Bit LCD Code..

Pls Help Me.. If Someone know how to do this..

Munish Kaundal
munishK301

posted on 2012/02/17 12:48:12 AM CET

Audio & Speech

Timer0 Interrupt code on Stellaris LM3S9B95

Hi

Does anyone have a code for Timer0 Interrupt on Arm Stellaris LM3S9B95( MMB Borad )??
i am working on my Project and want to develop a Mobile keypad cursor, so thats why i need Timer0 Interrupt.

Thanks,
Munish K

Farrukh Hussain
programmer5

posted on 2012/02/07 06:45:13 AM CET

Communication

I2C slave PIC in mikroC

please help me, i need mikroC 5.40 code for making PIC act as i2c slave, I'm thinking I just lost $250 for this compiler and I'm failed to get a working code from all sources.
please send me if anyone have it.
thanks a lot in advance.

Stevan Radišić
stevanr

posted on 2012/02/07 02:15:26 AM CET

Internal MCU modules

Q15 for AVR Compilers

I working on quick calculations (very delicate project in my company) on the MMB XMega and I need more speed (Standard I consume a lot of processor cycles while this is not the case for dsPIC)
Please, if somebody have library or Mikroe Team can easly precompile lib from PIC to AVR.
THX.

first | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 last