Page 1 of 1

CTS and RTS on software com port

Posted: 04 July 2013, 13:51 PM
by sturgessb
Hello

Sorry have been trying this every which way I can think of but I'm doing something wrong.

I just need RTS and CTS flow control on my software com port.

I am adding setting up like this..

Code: Select all

Call OpenQueue(com3RXQueue, SizeOf(com3RXQueue))
	Call OpenQueue(com3TXQueue, SizeOf(com3TXQueue))
	Call DefineCom(3, com3rx_pn, com3tx_pn, &H08)
	
	Call OpenCom(3, 9600, com3RXQueue, com3TXQueue)
	Call ControlCom(3, 27, 28)
Have tried swapping the pin numbers incase i have them wrong and tried both flags, also tried placing control com before open com.

What am i missing?

Cheers

Ben

Re: CTS and RTS on software com port

Posted: 04 July 2013, 16:00 PM
by dkinzer
sturgessb wrote:What am i missing?
What are you seeing?

The ControlCom() call should be made after the OpenCom() call as you've shown. As soon as it is executed, pin 27 should be high indicating that it is OK to transmit to the ZX. Pin 28 should be an input and if that pin is high the ZX will transmit any data available in the output queue.

You can test the operation by connecting pullup resistor and a switch to ground to pin 28. Closing the switch should prevent the ZX from transmitting, opening it should allow transmission. Similarly, you can send characters to the ZX and if they are not removed from the receive queue pin 27 will eventually go low indicating that nothing more should be sent.

Posted: 04 July 2013, 20:36 PM
by dlh
Also, what's on the other end of the serial link? Some USB-Serial adapters do not handle handshaking lines as they should.