Sending a voltage to RS232

后端 未结 3 471
[愿得一人]
[愿得一人] 2021-01-15 01:58

I know that we can use pin no.3 to send the data as a output in RS232. But I am just wondering that there is another way to send only the voltage 5v to the RS232 in a short

3条回答
  •  半阙折子戏
    2021-01-15 02:41

    You could use the DTREnable (Data Terminal Ready) property of the SerialPort class to apply a positive voltage to those respective pins. This could be used to signal an MCU.

    Something along the lines of...

    serialPort.DtrEnable = true; //High
    currentThread.Sleep(1000);
    serialPort.DtrEnable = false; //Low
    currentThread.Sleep(1000);
    

    However! the voltage is likely to be incompatible as RS232 operates -25 to 25 volts for 1/0's. You will likely need an inline driver/receiver such as a MAX232 chip to operate between the MCU and computer, or dependant on your skill level you could build a receiver circuit.

提交回复
热议问题