Home/Support/Support Forum/R6000 PC2 always is alternate function
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

R6000 PC2 always is alternate function

0 votes
On the R6000, I use PC3 as the serial TXC port. PC2 is set as normal function. However, when the serial port C is opened, PC2 suddenly becomes TXC. What's going on? Anyone seen this happen?

The code:
WrPortI (PCDDR, &PCDDRShadow, PCDDRShadow | 0x0F); //PC[3:0] outputs.
WrPortI (PCDCR, &PCDCRShadow, PCDCRShadow & 0xF0); //PC[3:0] totem pole outputs.
WrPortI (PCALR, &PCALRShadow, PCALRShadow & 0x3F); //PC[3] is TXC.
BitWrPortI (PCFR, &PCFRShadow, 1, 3); //PC[3] is alternate function.
//Okay to here, PC2 can be toggled. Then...
serCopen (9600); //and PC2 becomes TXC.
asked Oct 14, 2014 in Rabbit Software by AlanS New to the Community (1 point)

Please log in or register to answer this question.

2 Answers

0 votes
The default pins used by RS232.lib for serial port C are pins PC2 and PC3. There are macros that you can use to change the pins that serial port C uses. See the function description for serCopen()
answered Oct 15, 2014 by trooper2 Veteran of the Digi Community (589 points)
0 votes
Thanks! As you said and the function help stated, serCopen() assigns PC2 and PC3 to TXC. Could have used the macros but I chose an explicit assignment to help make future debugging clearer:

BitWrPortI (PCFR, &PCFRShadow, 0, 2); //PC[2] is NOT alternate function.
answered Oct 21, 2014 by AlanS New to the Community (1 point)
...