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

CCP5 no output

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



Joined: 15 Sep 2003
Posts: 226

View user's profile Send private message

CCP5 no output
PostPosted: Thu Aug 05, 2004 11:26 pm     Reply with quote

CCP1 works like a charm, CCP5 no o/p.
It all seems very simple... !

port G,4 as o/p Set_Tris_G(0b00000100);
C244: MOVLW 04
C246: MOVWF F98

setup_timer_2(T2_DIV_BY_1,96,1); // common for all CCP's

................... setup_ccp1(CCP_PWM);
C280: MOVLW B7
C282: ANDWF FB1,F
C284: BCF F8B.2
C286: MOVLW 0C
C288: MOVWF FBD
.................... setup_ccp5(CCP_PWM);
C28A: MOVLW B7
C28C: ANDWF FB1,F
C28E: BCF F8F.4
C290: MOVLW 0C
C292: MOVWF F70

.................... set_pwm1_duty ( 128 );
C29E: MOVLW 80
C2A0: MOVWF FBE
.................... set_pwm5_duty ( 128 );
C2A2: MOVWF F71

What else is there to take care of ?

Errata sheet does mentions a problem with CCP5...

What's the trick to making CCP5 work with PIC18F6720 ?
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Fri Aug 06, 2004 6:16 am     Reply with quote

Just for grins, try using timer4 as the source for the PWM as see if that makes a difference. Take a look and Figure 16-1 in the datasheet if you need more info on how to set it up. What is the date code on the chips that you are using? I have a board here that uses a 6720 also. I'll give it a test to see if it fails for me too.
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Fri Aug 06, 2004 7:00 am     Reply with quote

Okay, it works for me. Now I am running at 20MHz BUT a value of 128 did not work, 96 was the highest I could go.
Guest








It works
PostPosted: Fri Aug 06, 2004 9:01 am     Reply with quote

Mark wrote:
Okay, it works for me. Now I am running at 20MHz BUT a value of 128 did not work, 96 was the highest I could go.

Mark,
It must have been too late last night... of course it works. I need a vacation :-)
Thanks for the testing sorry to have wasted your time...
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Fri Aug 06, 2004 12:25 pm     Reply with quote

It didn't work for me at first. Silly me put the set_tris function above main(). The compiler didn't error and of course the port wasn't setup as an output. Maybe I could use one of those vacations too! Where are we headed Very Happy
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