CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

How big "delay_number"

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
jjude



Joined: 12 Nov 2007
Posts: 37

View user's profile Send private message

How big "delay_number"
PostPosted: Wed Sep 09, 2009 9:12 am     Reply with quote

Sorry bad english.
How big delay number can is?
delay_us(1500) is Ok.
delay_us(15000), is this OK??
Code:

#DEFINE number 1500
.
.
.
void clock_nyppy()
{
   viive=number;
   if(input(raja_cw) == 0) viive=number*10;
   pulssi_on;
   delay_us(viive);
   pulssi_off;
   delay_us(viive);
}

Its OK?
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Wed Sep 09, 2009 10:42 am     Reply with quote

it depends on the PIC.

on an 18F (PCH compiler) delay_ms accepts a 8 bit variable. But is a constant is used then it can 16 bit constant.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
jjude



Joined: 12 Nov 2007
Posts: 37

View user's profile Send private message

PostPosted: Wed Sep 09, 2009 11:15 am     Reply with quote

Quote:

it depends on the PIC.

16F526
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Sep 09, 2009 12:09 pm     Reply with quote

Actually in version 4.xxx of the compiler, you can use either a constant
or a variable up to 16-bits. This works in PCM, PCH, etc.
From the manual:
Quote:

delay_us( )

Syntax: delay_us (time)
Parameters: time - a variable 0-65535(int16) or a constant 0-65535

-----------------------

delay_ms( )

Syntax: delay_ms (time)
Parameters: time - a variable 0-65535(int16) or a constant 0-65535
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group