Sorry I was wrong, deleting the line CCP2CON=3D 0x00 is not enough. I dont know why ccp2if is always 0. -----Original Message----- From: Carlos Ojea To: Carlos Ojea ; pic microcontroller discuss= ion list Date: mi=E9rcoles 26 de diciembre de 2001 13:42 Subject: Re: [PIC]: CCP2 does not interrupt > >Emm, sorry I found the problem. >It was the line CCP2CON =3D 0x00;. Deleting this line it works. > > > >-----Original Message----- >From: Carlos Ojea >To: pic microcontroller discussion list >Date: mi=E9rcoles 26 de diciembre de 2001 13:31 >Subject: [PIC]: CCP2 does not interrupt > > >>Hello : >> >>I want to use ccp2 in capture mode, but I dont understand why CCP2IF is >>always '0'. >> >>I do this init: >> >> TMR3H =3D 0x00; >> TMR3L =3D 0x00; >> T3CONbits.TMR3CS =3D 0; >> T3CONbits.TMR3ON =3D 1; >> >> CCP2CON =3D 0x00; >> TRISBbits.TRISB3=3D 1; >> CCP2CON =3D 0x04; >> PIR2bits.CCP2IF =3D 0; >> PIE2bits.CCP2IE =3D 1; >> INTCONbits.PEIE =3D 1; >> INTCONbits.GIE =3D 1; >> message =3D 0; >> >>And then, in my interrupt routine I do this: >> >>void InterruptHandler() >>{ >> >> if(PIR2bits.CCP2IF && PIE2bits.CCP2IE) >> >> >> PIR2bits.CCP2IF =3D 0; >> message =3D 1; >> } >> return; >>} >> >>Value of 'message' is always 0 because CCP2IF is always 0, and I am sur= e >>that in my RB3/CCP2 pin I have a signal changing between 5v and 0v ever= y >>second. >> >>What is happening? >> >> > -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body