|
|
View previous topic :: View next topic |
Author |
Message |
andypak
Joined: 29 Sep 2009 Posts: 2
|
CCP1 as PWM - configuration?!?!? |
Posted: Tue Sep 29, 2009 5:02 am |
|
|
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
|
|
Posted: Tue Sep 29, 2009 5:17 am |
|
|
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
|
|
Posted: Tue Sep 29, 2009 5:49 am |
|
|
Ok, thank you, I'll try to buy another version.
Andrea |
|
|
|
|
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
|