View Single Post
  #1   Spotlight this post!  
Unread 22-06-2005, 14:18
ImmortalAres ImmortalAres is offline
Registered User
no team
 
Join Date: May 2005
Location: Clarkson University
Posts: 33
ImmortalAres is an unknown quantity at this point
Question about kevin's code

the code found here: http://kevin.org/frc/edu_accel_lcd.zip

contains the following

Code:
// initialize CCP modules 2 & 3
	TRISEbits.TRISE7 = 1;		// set CCP pins to inputs
	TRISGbits.TRISG0 = 1;

	PIE2bits.CCP2IE = 0;		// disable the CCP interrupts
	PIE3bits.CCP3IE = 0;

	T3CONbits.T3CCP1 = 0;		// CCP 2 captures timer 1, CCP 3 captures timer 3
	T3CONbits.T3CCP2 = 1;

	CCP2CON = 0x05;				// initialize CCP modules to capture on each rising edge
	CCP3CON = 0x05;

	IPR2bits.CCP2IP = 0;		// CCP modules use the low priority interrupt
	IPR3bits.CCP3IP = 0;		//

	PIR2bits.CCP2IF = 0;		// make sure the interrupt flags are zero before...
	PIR3bits.CCP3IF = 0;		//

	PIE2bits.CCP2IE = 1;		// enable the CCP interrupts
	PIE3bits.CCP3IE = 1;		//
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

Thanks