Dialog Semiconductor customer support - harware flow control https://support.dialog-semiconductor.com/resource-keywords/harware-flow-control en dsp硬件流控制 https://support.dialog-semiconductor.com/dsps-hardware-flow-control

Hello,

I use the DSPS sample with hardware flow control on pins :
TX : p1.0
RX : p1.2
RTS : p0.7
CTS : p0.5

I use a PAN1740 USB devkit and a pad that receive serial over bluetooth data from module.
When I plug a line (RTS or CTS) from my PIC to the module, this one crash (maybe reset) after a little time...

The code of the PIC :
inline void usart_write(char data) {
RTS = 0; // Host ready for transmit
while(CTS == 1); // Wait for device ready
while(PIR1bits.TXIF == 0); // Wait for empty buffer
TXREG = data;
while(TXSTAbits.TRMT == 0); // Wait for transmit end
RTS = 1; // Transmit end
}

RTS for PIC is an output and CTS an input.
Without flow control the pad receive wrong data because module sometime sleep.

What am I doing wrong ?

Thanks,

Morgane Vallée

Device: 
Wed, 27 May 2015 09:51:19 +0000 aeris 1598 at https://support.dialog-semiconductor.com https://support.dialog-semiconductor.com/dsps-hardware-flow-control#comments