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

#PIN_SELECT problems
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
12Lapointep



Joined: 04 Aug 2015
Posts: 16
Location: United States

View user's profile Send private message

PostPosted: Wed Aug 05, 2015 11:11 am     Reply with quote

Certain PICs microcontrollers have remappable I/O pins for peripheral devices but it is not clearly indicated in the datasheet. For example, the PIC18F67J94 has four groups of remappable pins so for example U1TX is assigned to one group of RPP whereas U1RX is assigned to another group of RPP.

Be careful of what you are using as RPP because I made the mistake in the past and it is no fun to add jumpers on the PCB.
40inD



Joined: 30 Jul 2007
Posts: 112
Location: Moscow, Russia

View user's profile Send private message

PostPosted: Thu Jun 02, 2016 8:26 am     Reply with quote

Hi!
I try to select pin for CCP2 to PIN_B3 for 18F25K22. I write
Code:
#pin_select CCP2=PIN_B3

but compiler says "Invalid Pin ID"
jeremiah



Joined: 20 Jul 2010
Posts: 1353

View user's profile Send private message

PostPosted: Thu Jun 02, 2016 4:38 pm     Reply with quote

40inD wrote:
Hi!
I try to select pin for CCP2 to PIN_B3 for 18F25K22. I write
Code:
#pin_select CCP2=PIN_B3

but comiler says "Invalid Pin ID"


I don't have that PIC, but normally pin_select is for "Peripheral Pin Select" which I didn't see a section for in the data sheet. Perhaps take a look at section 10.3.3 for a description of how to change the pins?
40inD



Joined: 30 Jul 2007
Posts: 112
Location: Moscow, Russia

View user's profile Send private message

PostPosted: Fri Jun 03, 2016 12:15 am     Reply with quote

From datasheet:
Quote:
14.1.1 CCP PIN CONFIGURATION
In Capture mode, the CCPx pin should be configured
as an input by setting the associated TRIS control bit.
Some CCPx outputs are multiplexed on a couple of
pins.
Table 14-2 shows the CCP output pin
multiplexing. Selection of the output pin is determined
by the CCPxMX bits in Configuration register 3H
(CONFIG3H).
Ttelmah



Joined: 11 Mar 2010
Posts: 19535

View user's profile Send private message

PostPosted: Fri Jun 03, 2016 1:19 am     Reply with quote

OK.

Deep breath.... Smile

#PIN_SELECT, is only used on chips that have 'PPS' (peripheral pin select). hence the name.

There are three basic 'types' of PIC (ignoring the 'families' like 12,16,18 etc.), when it comes to 'pins'.

The first (original) had fixed pins only. No re-mapping.
Then some PIC's came along with _fuse multiplexing_. On these a few specific peripherals could be moved between two or three locations, controlled by fuses.
Then you have chips with PPS.

Your chip does not have PPS. It has fuse multiplexing (the key is that the 'configuration register', is the fuses.....).

Your PIC only allows the pins to be changed by fuses. So can't be changed actually inside the code.

Key is then to look at the header file for the PIC. On ones with PPS, the peripheral names that can be changed are listed, together with the pins they can be mapped to. On yours you have no PPS entries, but instead you have the following fuses:

TIMER3B5,TIMER3C0 //Selects the pin Timer3 is multiplexed to
CCP2B3,CCP2C1
CCP3C6,CCP3B5
CCP2C0,CCP2B5 //controls CCP2 and CCP3 multiplexing

So you need the fuse CCP2B3
40inD



Joined: 30 Jul 2007
Posts: 112
Location: Moscow, Russia

View user's profile Send private message

PostPosted: Fri Jun 03, 2016 1:39 am     Reply with quote

Thanks!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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