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.