µTasker Forum

µTasker Forum => NXPTM M522XX, KINETIS and i.MX RT => Topic started by: neil on August 07, 2009, 04:00:06 PM

Title: Disabling Rx Port
Post by: neil on August 07, 2009, 04:00:06 PM
Hi Mark,
  I am using one of the Uart connected to a RS485 chip, what ever gets sent out on the tx line also goes onto the rx line, as its half duplex. I set a break in the tx line before sending a command and would like to disable the RX line at the start of the break, and enable it after the breakis complete. I dont mind the characters being returned as I can ignore them, but dont want the break line coming back in.

Is the best way to solve this is to use fnDriver( SerialPortID, RX_OFF , 0 ); , turn back on using the MODIFY_CONFIG?

Is there need to do a fnFlush( SerialPortID, FLUSH_RX); after a MODIFY_CONFIG?

Rgrds,
Neil
Title: Re: Disabling Rx Port
Post by: mark on August 07, 2009, 09:40:05 PM
Hi Neil

fnDriver( SerialPortID, RX_OFF , 0 ); will disable the rx but not flush any input which has already arrived. A flush would ensure that the input buffer is really empty and so could be used as a second step.
Alternatively you could read any input data and discard it.

Regards

Mark