View previous topic :: View next topic |
Author |
Message |
kcnicho
Joined: 11 Apr 2005 Posts: 2
|
PCHW Compiler V 3.218 "SETUP_Timer_2/4()" Problem |
Posted: Mon Apr 11, 2005 7:09 pm |
|
|
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
|
|
Posted: Mon Apr 11, 2005 7:51 pm |
|
|
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
|
Thanks! |
Posted: Mon Apr 11, 2005 9:47 pm |
|
|
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
|
|
Posted: Tue Apr 12, 2005 5:48 am |
|
|
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
|
|
Posted: Tue Apr 12, 2005 6:13 am |
|
|
The manual also shows how to use those functions correctly and gives examples. |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Tue Apr 12, 2005 10:44 am |
|
|
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. |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Tue Apr 12, 2005 10:55 am |
|
|
I've got one from July '99. It does too. Man is it thin compared to the new one |
|
|
|