If you are using CCS "C" then the delay_ms() function only supports 8-bit variables as the parameter, 16-bit values have to be constants. The maximum delays available are 255mS using a variable and 65535mS for a constant. If you need longer delays you can put the delay inside a "for" loop. To make a 16-bit value more maintainable you can use a preprocessor define instead of a variable: #define A_DELAY 100 #define B_DELAY 359 #define C_DELAY 7890 delay_ms(A_DELAY); delay_ms(B_DELAY); delay_ms(C_DELAY); To use a variable with the default data type assignments you would do this: int a = 100; delay_ms(a); Paul > i'm using a 16F877 PIC. > I've written a small program in C. > It is divided in 8 states, and each has it's own delay. I'm using > delay_ms() > to specify the delay. > I wanted to define lets say a=100, b=359, c=7890, so in the program i can > write delay_ms(a), delay_ms(b),delay_ms(c) etc, instead of writing tha > actual number in seconds. I tried defining: long int a = > 100(didint work), > and later saw in the manual that delay_ms() is expecting a number in > milliseconds. > > Is there a simple way to get aroound it ? -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads