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 support@ccsinfo.com

CCP1 as PWM - configuration?!?!?

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



Joined: 29 Sep 2009
Posts: 2

View user's profile Send private message

CCP1 as PWM - configuration?!?!?
PostPosted: Tue Sep 29, 2009 5:02 am     Reply with quote

Hi to all,
I have a configuration problem on CCP1 (PIC18F4620). I'd like use this as PWM and so I have used the following instruction:
setup_ccp1 (CCP_PWM);

but CCS compiler 4.017 give the following error:

*** Error 102 "D:\Progetti PIC\PHACO\ligiSource\t-mainm.c" Line 1579(23,24): Expect comma

so I have wrote
setup_ccp1 (CCP_PWM,CCP_PWM_H_H);
but the PWM is always OFF. Before use this CCS version I used another version that now I don't remember and with this old version I haven't any errors.

after this instruction I have put these others:
setup_timer_2 (T2_DIV_BY_1, 255, 1);
set_pwm1_duty (50);

Which is the correct instruction?

Andrea
Ttelmah
Guest







PostPosted: Tue Sep 29, 2009 5:17 am     Reply with quote

First, do a search 'back' about V4 versions. Unfortunately, the 'sticky' thread that existed for a couple of years athe top of this forum, has now gone, but V4.017, is unlikely to work.
Basically, you can reckon that anything before the late 4.030 releases, _will_ have major issues...

On your chip, V4, adds the options to configure the ECCP features. However these are meant to be 'optional', with the ECCP module being 'reverse compatible' with the normal CCP. Unfortunately, your compiler is not correctly handling this. On a more modern compiler, the standard syntax is accepted, and works. You have two choices:

1) Write the required control bytes directly to the registers yourself, and hope that none of the other bugs with this compiler version jump out later....
2) Update the compiler.

Best Wishes
andypak



Joined: 29 Sep 2009
Posts: 2

View user's profile Send private message

PostPosted: Tue Sep 29, 2009 5:49 am     Reply with quote

Ok, thank you, I'll try to buy another version.

Andrea
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