controle arduino sketch via CTS or DTR signals out of PC program.

Hi,

I have a windows program witch uses CTS or DTR to controll a transmitter state.
I have arduino nano connected to this PC witch among other activity also drives the transmitter state.
Now the ideal way is to use the CTS data from the windows program and detect is in the arduino for usage of this transmitter state...

So setup is simple.
Nano is making serial port in pc (eg port 13) windows program is setup to use port 13 to controll its CTS line for transmitting.

Question: what code should i use to detect the CTS signal in my sketch...

I understand that CTS and DTR handshaking is not used but i relly hope the data signal is somewhere...

Benno

The DTR pin is used to reset the ATmega328P microcontroller on the Nano. The CTS pin is not connected to anything. So the closest you could get is to detect the DTR signal by the reset of the microcontroller. This is possible because the reset causes the setup function of your sketch to run.

Thanks,

Found that on my nano de CTS and de DSR pins are available on my Nano board out of the CH340
(9 and 10) but they are not connected to annything.. Simply connect them to the D11 and D12 inputs on the Nano witch next to the CH340 chip makes it work...

However this was not the solution to my problem..
As a didn't red the manual of my software correctly.

CTS and DSR are the PTT input into the windows software..

PTT output was via HID relay device controlled...

Now my new question: how to turn my Nano as a HID relay device...
Lots of options to controll windows via HID data like external keyboards of mouse..
But i can't find a simple HID relay output library...

I also need to controll the vendor device info as the windows program expects to see.
x16C0, device ID is x05DF

Anny update on this???

Best regards
Benno

plantjes:
Now my new question: how to turn my Nano as a HID relay device...
Lots of options to controll windows via HID data like external keyboards of mouse..
But i can't find a simple HID relay output library...

I don't know anything about HID relay devices, but for HID in general I think you would want to switch to using one of the native USB Arduino boards like the Pro Micro, Micro, or MKR Zero.

plantjes:
I also need to controll the vendor device info as the windows program expects to see.
x16C0, device ID is x05DF

I don't know if that's possible with the CH340. I know you can do it with the FT232 used on the official Nano using the FTProg software FTDI provides on their website, or you can do it when using one of the native USB boards by editing the values in its definition in boards.txt (I can provide instructions for that if you like).