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

PIC18F8720 - strange error

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



Joined: 26 Sep 2003
Posts: 48

View user's profile Send private message

PIC18F8720 - strange error
PostPosted: Thu Feb 05, 2004 11:00 am     Reply with quote

Hi,

I'm using all PWM pins of 18F8720. my initialization code is:

setup_ccp1(CCP_PWM);
set_pwm1_duty(0);
SETUP_CCP2(CCP_PWM);
set_pwm2_duty(0);
setup_ccp3(CCP_PWM);
set_pwm3_duty(0);
setup_ccp4(CCP_PWM);
set_pwm4_duty(0);
setup_ccp5(CCP_PWM);
set_pwm5_duty(0);



all of the sudden it stop to work and I get the following errors:

*** Error 12 "D:\chile_SW\SW_04390.c" Line 174(1,11): Undefined identifier SETUP_CCP2
*** Error 12 "D:\chile_SW\SW_04390.c" Line 175(1,14): Undefined identifier set_pwm2_duty
*** Error 12 "D:\chile_SW\SW_04390.c" Line 176(1,11): Undefined identifier setup_ccp3
*** Error 12 "D:\chile_SW\SW_04390.c" Line 177(1,14): Undefined identifier set_pwm3_duty
*** Error 12 "D:\chile_SW\SW_04390.c" Line 178(1,11): Undefined identifier setup_ccp4
*** Error 12 "D:\chile_SW\SW_04390.c" Line 179(1,14): Undefined identifier set_pwm4_duty
*** Error 12 "D:\chile_SW\SW_04390.c" Line 180(1,11): Undefined identifier setup_ccp5
*** Error 12 "D:\chile_SW\SW_04390.c" Line 181(1,14): Undefined identifier set_pwm5_duty


some one could help me?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Feb 05, 2004 11:50 am     Reply with quote

Did you change the #include file ?

For example, if I take your code and compile a test program,
it compiles with no errors.

#include <18F8720.h>
#use delay(clock = 4000000)

void main()
{
setup_ccp1(CCP_PWM);
set_pwm1_duty(0);
SETUP_CCP2(CCP_PWM);
set_pwm2_duty(0);
setup_ccp3(CCP_PWM);
set_pwm3_duty(0);
setup_ccp4(CCP_PWM);
set_pwm4_duty(0);
setup_ccp5(CCP_PWM);
set_pwm5_duty(0);
}

But if I change the top line to this:
#include <18F242.h>
then I get lots of errors.
agrj



Joined: 26 Sep 2003
Posts: 48

View user's profile Send private message

PostPosted: Thu Feb 05, 2004 12:26 pm     Reply with quote

PCM programmer wrote:
Did you change the #include file ?

For example, if I take your code and compile a test program,
it compiles with no errors.

#include <18F8720.h>
#use delay(clock = 4000000)

void main()
{
setup_ccp1(CCP_PWM);
set_pwm1_duty(0);
SETUP_CCP2(CCP_PWM);
set_pwm2_duty(0);
setup_ccp3(CCP_PWM);
set_pwm3_duty(0);
setup_ccp4(CCP_PWM);
set_pwm4_duty(0);
setup_ccp5(CCP_PWM);
set_pwm5_duty(0);
}

But if I change the top line to this:
#include <18F242.h>
then I get lots of errors.


at the top I have:

#include <18F8720.h>
#use i2c(Master,fast,sda=PIN_C4,scl=PIN_C3,restart_wdt) //,force_hw)
//#device ICD=TRUE
//#device adc=8
#use delay(clock=25000000,RESTART_WDT)
#fuses HS,NOWDT,WDT128
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,stream=TIMS,enable=PIN_C5,restart_wdt,errors)
#use rs232(baud=57600,parity=E,xmit=PIN_G1,rcv=PIN_G2,BRGH1OK,bits=8,stream=RS232,restart_wdt,errors)

I will try your code and see what happens.
agrj



Joined: 26 Sep 2003
Posts: 48

View user's profile Send private message

PostPosted: Thu Feb 05, 2004 12:28 pm     Reply with quote

Hi,

I compile your code and get the same errors:

Deleting intermediary files... done.
Executing: "C:\Arquivos de programas\PICC\Ccsc.exe" "a.c" +FH +DF +LN +T -A +M +Z +Y=9 +EA
*** Error 12 "d:\lixo\a.c" Line 8(1,11): Undefined identifier SETUP_CCP2
*** Error 12 "d:\lixo\a.c" Line 9(1,14): Undefined identifier set_pwm2_duty
*** Error 12 "d:\lixo\a.c" Line 10(1,11): Undefined identifier setup_ccp3
*** Error 12 "d:\lixo\a.c" Line 11(1,14): Undefined identifier set_pwm3_duty
*** Error 12 "d:\lixo\a.c" Line 12(1,11): Undefined identifier setup_ccp4
*** Error 12 "d:\lixo\a.c" Line 13(1,14): Undefined identifier set_pwm4_duty
*** Error 12 "d:\lixo\a.c" Line 14(1,11): Undefined identifier setup_ccp5
*** Error 12 "d:\lixo\a.c" Line 15(1,14): Undefined identifier set_pwm5_duty
8 Errors, 0 Warnings.
Halting build on first failure as requested.
BUILD FAILED


I'm using CCS 3.184 with maplab 3.42

any clues?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Feb 05, 2004 1:37 pm     Reply with quote

I used your pre-processor statements with PCH vs. 3.178,
and it compiled with no errors.

If it was working for you with 3.184, and then it started failing,
then you should look for some configuration problem in MPLAB
or the compiler. Possibly, re-install the compiler.
agrj



Joined: 26 Sep 2003
Posts: 48

View user's profile Send private message

PostPosted: Thu Feb 05, 2004 1:44 pm     Reply with quote

I reinstalled the compiler and now everything came back to normal.

even though it should not happen, should it?

thanks
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