View previous topic :: View next topic |
Author |
Message |
Hans Wedemeyer
Joined: 15 Sep 2003 Posts: 226
|
CCP5 no output |
Posted: Thu Aug 05, 2004 11:26 pm |
|
|
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
|
|
Posted: Fri Aug 06, 2004 6:16 am |
|
|
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
|
|
Posted: Fri Aug 06, 2004 7:00 am |
|
|
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 |
Posted: Fri Aug 06, 2004 9:01 am |
|
|
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
|
|
Posted: Fri Aug 06, 2004 12:25 pm |
|
|
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 |
|
|
|