This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Use RTS/CTS as GPIOs

Hello,

I'm writing code for a SensorTag (CC2541) and I use an UART without flow control. Can I reuse pins RTS/CTS (P1.3/P1.2) as GPIO pins?

I wrote the following code:

#define SETPORT(port,pin) {port |= (1<<pin);}
#define CLRPORT(port,pin) {port &= ~(1<<pin);}

// P1.2 (blue) = DISPLAY serially debug values
// P1.3 (grey) = DISPLAY TRIGGER debug

CLRPORT(P1SEL,2); // P1.2 as GPIO 
CLRPORT(P1SEL,3); // P1.3 as GPIO 
SETPORT(P1DIR,2); // P1.2 as output
SETPORT(P1DIR,3); // P1.3 as output
SETPORT(P1,2); // Serial inactive at 1
CLRPORT(P1,3); // Trigger inactive at 0

However, I don't see P1.3 (RTS pin 3 of P1 BL_SMD_1x6_1_27 connector) going to 0 (stay at 1).

I would appreciate for debugging to be able to display TRIGGER pulses on this port to help the debug with a Logic analyzer since it's easy to solder wires on this connector.

UART is configured with:

// Use UART on P1.4 & P1.5
P1SEL |= 0x30;
PERCFG |= 0x01; // UART 0 location: alternative 1
U0GCR = 11; // LSB first 115200 baud
U0BAUD = 216;
U0UCR = 0x82; // Flush, Flow control disabled, 8 bits, parity dis, 1 stop bit, high stop bit, low start bit
U0CSR = 0xc0; // UART mode, Receiver enabled

uint8 buffer[3];

buffer[0] = 0x12;
buffer[1] = 0x34;
buffer[2] = 0x56;

HalUARTWrite(HAL_UART_PORT_0, (uint8*)buffer, sizeof(buffer));

And I can see the values 0x12, 0x34 & 0x56 serially sent on Tx (P1.5).

Thanks for any kind of help

Bernard