I'm trying to redirect the CCP2 output for PWM on a PIC18LF2620 to the alternate port pin on B3. The default pin for the CCP2 function is on pin C1.
According to the datasheet, it states the CCPMX2 register bit controls which port pin the function is on. By default, the CCPMX2 pin is high and the CCP2 function is directed to the C1 pin. It states to clear the CCPMX2 bit to re-route the CCP2 function to pin B3.
Where is the CCP2MX bit located? I can't seem to find it in any of the register defintions. The CCP2CON register has four bits labeled CCP2M3 through CCP2M0 but these bits are used for other functionality.
How can I redirect the CCP2 function to pin B3 using the CCS compiler functions?
I'm using PCWHD V4.107.
Thanks for any help.
dyeatman
Joined: 06 Sep 2003 Posts: 1924 Location: Norman, OK
Posted: Sun May 23, 2010 10:12 am
It is a bit in the CONFIG3H register.
In the datasheet, in Table 23-1 on Page 249, is where the address of the
CCP2MX bit can be found. I used search within the PDF file to find it.
From the device header file it looks like the CCP2B3 fuse should do it. The
fuse CCP2C1 can be used to set it the other way. _________________ Google and Forum Search are some of your best tools!!!!
starfire151
Joined: 01 Apr 2007 Posts: 195
Posted: Sun May 23, 2010 10:46 am
Thanks very much. I found the bit in the CONFIG3 register. I just set the #fuses CCP2B3 and all is well with the universe now
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum