CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

How to redirect CCP2 on 18LF2620?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
starfire151



Joined: 01 Apr 2007
Posts: 195

View user's profile Send private message

How to redirect CCP2 on 18LF2620?
PostPosted: Sun May 23, 2010 9:48 am     Reply with quote

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: 1933
Location: Norman, OK

View user's profile Send private message

PostPosted: Sun May 23, 2010 10:12 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sun May 23, 2010 10:46 am     Reply with quote

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 Very Happy
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group