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

PCHW Compiler V 3.218 "SETUP_Timer_2/4()" Problem

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



Joined: 11 Apr 2005
Posts: 2

View user's profile Send private message

PCHW Compiler V 3.218 "SETUP_Timer_2/4()" Problem
PostPosted: Mon Apr 11, 2005 7:09 pm     Reply with quote

Howdy,

PIC18F8720...

Just wondering if anyone else has had a problem compiling the simple line:

SETUP_TIMER_4(T4_DIV_BY_16);

or

SETUP_TIMER_2(T2_DIV_BY_16);

Both give the error: "Error[102] : Expect Comma".

Everything else in my program compiles fine when I comment out just those lines.


Thanks,

- Kevin
Charlie U



Joined: 09 Sep 2003
Posts: 183
Location: Somewhere under water in the Great Lakes

View user's profile Send private message

PostPosted: Mon Apr 11, 2005 7:51 pm     Reply with quote

Did you happen to look at the help file for those functions:

setup_timer_2 (mode, period, postscale)

Quote:
Examples:
setup_timer_2 ( T2_DIV_BY_4, 0xc0, 2);

// At 20mhz, the timer will include every 800ns,

// will overflow every 153.6us,

// and will interrupt every 460.3us.

kcnicho



Joined: 11 Apr 2005
Posts: 2

View user's profile Send private message

Thanks!
PostPosted: Mon Apr 11, 2005 9:47 pm     Reply with quote

Nope, I just looked at the book that came with the compiler (silly me!)

Thanks a lot!


- Kevin
Charlie U



Joined: 09 Sep 2003
Posts: 183
Location: Somewhere under water in the Great Lakes

View user's profile Send private message

PostPosted: Tue Apr 12, 2005 5:48 am     Reply with quote

The manual tends to lag behind as features and new processors are added. Also, don't forget to look at the readme file that is included with each new version. That is where CCS includes information on new features, etc.
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Tue Apr 12, 2005 6:13 am     Reply with quote

The manual also shows how to use those functions correctly and gives examples.
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Tue Apr 12, 2005 10:44 am     Reply with quote

Mark, you are right!
Even my 3 years old book (February 2002) shows the correct syntax for setup_timer_2. In other words, kcnicho had a nice try in talking himself out of this but should try next time to RTFM. Twisted Evil
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Tue Apr 12, 2005 10:55 am     Reply with quote

I've got one from July '99. It does too. Man is it thin compared to the new one Smile
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