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 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 last
abhi abhi
abhi

posted on 2012/03/07 07:28:50 AM CET

Communication

PWM and UART in mikroC PRO

hi
i tried following code for 18F2550 (20MHz) with default configataion at time of creating project

void main()
{
PORTB = 0; // Initialize PORTC
TRISB = 0; // Configure PORTC as output
PORTC = 0; // set PORTC to 0
TRISC = 128;
TRISA = 0xFF;
UART1_Init(9600); // Initialize UART module at 9600 bps
PWM1_Init(1000);
Delay_ms(100); // Wait for UART module to stabilize
while(1)
{
.
.
.
.
.
}

compiler gives an error at either PWM1_init or UART_init

it comlipe either PWM or UART at a time
individualy PWM and UART works as usual
but when i tried at as above it dose not work pleas help me
i guess it may be problem with configuration only but i could not found

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.

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