发送电压RS232 [英] Sending a voltage to RS232

查看:231
本文介绍了发送电压RS232的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道,我们可以用针三号将数据发送作为一个RS232输出。但我只是想知道,还有另一种方式,只有电压5V发送到RS232在很短的时间?我只想说5V触发PIC单片机做一些事情。

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 period? I just want that 5v to trigger a PIC Microcontroller to do something.

感谢您提前。

推荐答案

您可以使用SerialPort类的DTREnable(数据终端就绪)属性设置为一个正电压适用于那些相关的管脚。这可以用于对信号的MCU

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.

沿着...

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



不过!在电压很可能是不兼容为RS232操作-25到25伏1/0。您可能需要一个内嵌驱动器/接收器,如MAX232芯片MCU和计算机,或依赖于你的技术水平,你可以建立一个接收机电路之间的操作。

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.

这篇关于发送电压RS232的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆