View Single Post
  #3   Spotlight this post!  
Unread 22-06-2005, 17:24
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,366
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
Re: Question about kevin's code

Quote:
Originally Posted by ImmortalAres
my question is about the 2 lines

Code:
T3CONbits.T3CCP1 = 0;		// CCP 2 captures timer 1, CCP 3 captures timer 3
T3CONbits.T3CCP2 = 1;
this doesn't make sense to me. can someone please explain what's going on, the comment doesn't seem to match the code or does it and i'm jsut missing it
Take a look at the datasheet, page 152, specifically figure 16-1. Notice Kevin is setting T3CCP1 to 0 and T3CCP2 to 1, which corresponds to T3CCP<2:1> = 10 in that figure. This shows that timers 1 and 2 are connected to CCP1 and CCP2, and timers 3 and 4 are connected to CCP3, 4, and 5. Then look at table 16-1 in the upper right corner, which says that in capture mode, timers 1 and 3 are available. You can check the settings of CCP2CON and CCP3CON to see that they are being set to capture mode, so you can conclude from all this that CCP2 captures timer 1 and CCP3 captures timer 3, just like the comment says.