Problem UART CTS and BLE module

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Problem UART CTS and BLE module

1,914 次查看
ypkdani
Contributor III

Hello,

i have a problem using the UART CTS with my K22FX512 and the BLE module RN4871.

I have enable the CTS pin with:

PORTC->PCR[15] = PORT_PCR_MUX(3); /* set PORTC pin 15 to UART4_TX*/
PORTC->PCR[14] = PORT_PCR_MUX(3); /* set PORTC pin 14 to UART4_RX*/
PORTC->PCR[13] = PORT_PCR_MUX(3); /* set PORTC pin 12 to UART4_RTS*/
PORTC->PCR[12] = PORT_PCR_MUX(3) | PORT_PCR_PE_MASK; /* set PORTC pin 13 to UART4_CTS*/

and 

/* Enable CTS flow control */
UART4->MODEM |= UART_MODEM_TXCTSE_MASK;
/* Enable receiver and transmitter */
UART4->C2 |= (UART_C2_RIE_MASK | UART_C2_TE_MASK | UART_C2_RE_MASK);

so the CTS is active and the RTS no.

Doing this happen that the CTS pin go high (despite the pull-down enable) and no communication begin. 

If i disable the CTS pin with

PORTC->PCR[15] = PORT_PCR_MUX(3); /* set PORTC pin 15 to UART4_TX*/
PORTC->PCR[14] = PORT_PCR_MUX(3); /* set PORTC pin 14 to UART4_RX*/
PORTC->PCR[13] = PORT_PCR_MUX(1);
PORTC->PCR[12] = PORT_PCR_MUX(1)

all work and the CTS pin remain low.

Why this happen? the cpu active a pull-up when the CTS pin is enable? 

PS: On my module RN4871 the flow control is always active.

Thanks

标签 (1)
0 项奖励
回复
2 回复数

1,601 次查看
ypkdani
Contributor III

Hello,

What i need is to control only the CTS to prevent to overflow the buffer of the BLE module.

What i don't understand is why :

  • when i set the PORT_PCR_MUX(3)  (pin CTS) OR the UART4->MODEM, the channel remain high
  • if i set PORT_PCR_MUX(1) and not enable the UART4->MODEM all works.

the flow control is always on on the BLE module. Seems like when i enable the CTS pin on the CPU it be keeped high

0 项奖励
回复

1,601 次查看
mjbcswitzerland
Specialist V

Daniele

CTS is an input to the UART and so its state is presumably being controlled by the BLE module.
Therefore the module may be controlling its output in dependency to your RTS signal (depending on the wiring) in an unexpected manner. Try testing the RTS/CTS mode without the BLE so that you are sure what is controlling the signals.

Regards

Mark

0 项奖励
回复