Search found 348 matches

by gambrose
04 Aug 2005 10:11
Forum: mikroC General
Topic: Functions - newbie
Replies: 2
Views: 2494

i think what you are having trouble with is that the function you are calling is not defined at the time you call it.

at the top of you file copy the function prototypes but end them with a ; not the usual braces {}
by gambrose
28 Jul 2005 21:09
Forum: mikroC General
Topic: BitTest and While or IF statement
Replies: 4
Views: 3441

the

Code: Select all

do{
}while(1) 
provide the simple goto loop but the compiler provides the loop label names which is a much better situation else you find your code jumping to a point in another function because you forgot you used that name already.
by gambrose
28 Jul 2005 17:29
Forum: mikroC General
Topic: BitTest and While or IF statement
Replies: 4
Views: 3441

I tend to write something like this if i am looking for performance. good idea get compiler to generate the labels.

Code: Select all

//do something

do
{

    //do something else

asm BTFSC     INTCON,T0IF
}while(1);

//continue program
by gambrose
29 Jun 2005 16:32
Forum: mikroBasic General
Topic: How to get money value"$x.xx"?
Replies: 8
Views: 4837

well you can either use string to int or you can store the values in dpb form.
by gambrose
27 Jun 2005 20:05
Forum: mikroC General
Topic: USART with PIC16F874A
Replies: 10
Views: 7027

Hi grisu
i tried to compile the program for 16F877A and ran it on the 16F874A like gambrose recommended.. no success..
Oh well was worth a try..
well it could be worse at least you have already sorted your work around. :wink:
by gambrose
24 Jun 2005 17:33
Forum: mikroC General
Topic: Compact Flash help
Replies: 3
Views: 3404

i don't think double posting helps.

Have you tried looking at what is written to the compact flash card to ascertain if it is the compact flash write or the read and display that is at fault.
by gambrose
24 Jun 2005 17:29
Forum: mikroC General
Topic: USART with PIC16F874A
Replies: 10
Views: 7027

I tested the first code with a P16F877A as that is the closest thing i have, it worked fine. I see your point about the TRMT Flag but if the TSR reg is empty it is always because the TXREG is also empty else it would be filled. I think all this means is that you lose out on the double buffering so y...
by gambrose
24 Jun 2005 11:46
Forum: mikroBasic General
Topic: How to get money value"$x.xx"?
Replies: 8
Views: 4837

how about using a string or a array to store the values.
by gambrose
24 Jun 2005 11:38
Forum: mikroC General
Topic: USART with PIC16F874A
Replies: 10
Views: 7027

So long as you initialize the library properly you should be fine. a few notes about your code. char msg[11] = "Hello World"; is wrong as you need a byte for the null terminator. it is much 'safer' to leave out the array length. char msg[] = "Hello World"; or char * msg = "Hello World"; also rather ...
by gambrose
24 Jun 2005 10:51
Forum: mikroC General
Topic: USART with PIC16F874A
Replies: 10
Views: 7027

USART_Write checks TRMT the Transmit Shift Register Status bit of TXSTA.

I would recommend that before you report an error you are running the latest version of mikroC as you will almost certainly be asked to upgrade as a mater of course. the latest versions have numerous bug fixes.
by gambrose
24 Jun 2005 10:34
Forum: mikroC General
Topic: How to combine hi and lo
Replies: 11
Views: 7624

I had a little play with these functions and looked at the help files in mikroPascal. I think the functions are very good as they are proper built in functions that insert the correct assembler name not a function call. i feel that the way they are documented in the help file is a little misleading ...
by gambrose
23 Jun 2005 09:22
Forum: mikroC General
Topic: How to combine hi and lo
Replies: 11
Views: 7624

that is very interesting.
these functions are not documented in the current mikroC are they due for the next release?

could you give a brief example on how to use them?
by gambrose
22 Jun 2005 15:27
Forum: mikroC General
Topic: How to combine hi and lo
Replies: 11
Views: 7624

Code: Select all

int range; // declare you int
unsigned short * ptr = ⦥ // obtain a reference to it

* ptr = 234; // load lower byte first
ptr++; // increment the pointer
* ptr = 1; // load the higher byte
note: Numbers are stored lowest byte first.
by gambrose
22 Jun 2005 10:56
Forum: mikroC General
Topic: How to combine hi and lo
Replies: 11
Views: 7624

would be nice to get access to each byte in ints and longs in the same sort of way we can access individual bits. have you considered using a pointer to byte assigning it the value of range then loading in highbyte adding one (or subtracting one i can't remember which) to the pointer then assigning ...
by gambrose
10 Jun 2005 16:56
Forum: mikroC General
Topic: Optrex 4x20 LCD witch HD44780 controller
Replies: 11
Views: 7969

In stead of using LCD_Out functions and having to use workaround line numbers why not use LCD_Cmd function and set the cursor position your self

look at the help file at the constants section so see what i mean there are constants for LCD_LINE_ONE etc. you could just use your own constants.

Go to advanced search