|
|
View previous topic :: View next topic |
Author |
Message |
tbob
Joined: 06 Dec 2006 Posts: 3 Location: Providence, RI
|
the answer has got to be easy... |
Posted: Wed Dec 06, 2006 9:35 am |
|
|
I'm using the CCS compiler as a plugin for MPLAB. It recognizes the output_g() function, but not the setup_power_pwm() function. Here's my code:
Code: |
#include <18F8722.h>
#fuses HS, NOWDT, NOPROTECT, NOLVP, BROWNOUT, PUT
//High Speed external oscillator, no Watchdog timer
//No code protection, no low voltage programming
//Brownout reset, Power up timer
#use DELAY (CLOCK=10000000) //Clock is 10MHz
#use fast_io(G)
void main (void)
{
output_g(0x08);
SETUP_POWER_PWM(PWM_FREE_RUN, 1, 65535, 4095, 128, 1, 0);
setup_power_pwm_pins(PWM_ODD_ON);
}
|
when I build, I get the following message:
Quote: |
Clean: Deleting intermediary and output files.
Clean Warning: File "C:\5DIS1000\BB_Motorcontrol\source\main.o" doesn't exist.
Clean: Done.
Executing: "C:\Program files\Picc\CCSC.exe" "main.c" "-I .\include" +FH +DF +LN +T -A +M +Z +Y=9 +EA
*** Error 12 "C:\5DIS1000\BB_Motorcontrol\source\main.c" Line 43(1,16): Undefined identifier SETUP_POWER_PWM
*** Error 12 "C:\5DIS1000\BB_Motorcontrol\source\main.c" Line 44(1,21): Undefined identifier setup_power_pwm_pins
2 Errors, 0 Warnings.
Halting build on first failure as requested.
BUILD FAILED: Wed Dec 06 10:19:09 2006
|
I've tried both uppercase and lowercase for the "SETUP_POWER_PWM" line. What am I missing!!?? thanks for the help, and sorry for noobing. |
|
|
jecottrell
Joined: 16 Jan 2005 Posts: 559 Location: Tucson, AZ
|
|
Posted: Wed Dec 06, 2006 9:49 am |
|
|
Look in the header file and see what the possible setup options are for the PWM.
John |
|
|
tbob
Joined: 06 Dec 2006 Posts: 3 Location: Providence, RI
|
|
Posted: Wed Dec 06, 2006 10:53 am |
|
|
OK, I'll look, but I'm not exactly sure what I'm looking for. There's a section on the CCP, which mentions SET_PWMx_DUTY(), but no mention of SETUP_POWER_PWM(). Is it possible that not all functions are available for all processors?
I'm using (in case you didn't glean from the code) an 18F8722.
thanks! |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Dec 06, 2006 11:00 am |
|
|
Also look in the data sheet. For example, the 18F4431 data sheet
has this section in it:
Quote: | 17.0 POWER CONTROL PWM MODULE |
The 18F8722 doesn't have it. |
|
|
Ttelmah Guest
|
|
Posted: Wed Dec 06, 2006 11:05 am |
|
|
Of course it is.
The point is that the .h file for the particular processor, lists which module control setups exist for the particular chip. The POWER_PWM module only exist in the 18F1220, 1230, 2331, 2431, 4331, & 4431 chips at present.
Hence before using a module, look at the data sheet for your chip, and see if it present, and then at the .h file to see what the configurations are.
Best Wishes |
|
|
|
|
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
|