由PC串口实现简单IR数据转换

技术分类: 微处理器与DSP  消费电子设计  | 2007-10-23
来源:EDN | 作者:Andreas Grün, Wedemark, Germany

  通过从PC串口传输适当的十六进制值到一对IR LED,遥控IR接收器能够实现38.4 kHz的数据传输。

  经常需要在没有直接电缆连接的情况下,传输一对位或字节的数据到微处理器。实现这个目标的简单方法是使用普遍采用的IR接收器,例如TV和VCR IR遥控使用的Vishay公司TSOP17xx或相似接收器。由于不需要外部器件,这些设备容易实现。它们通常与38kHz脉冲载波一起使用,包括放大器、自动增益控制和解调器。

  简单应用的主要问题是建立发射机,需要一个38kHz的间歇振荡器,附加供电电压和毫秒或低于毫秒级的调制脉冲。这些因素对PC操作系统而言很难控制。另一方面,PC的串口以38,400 bps的标准传输速率产生38.4kHz数据的精确脉冲,带有简单频率加倍装置和两个IR LED(图1)。当传输字节为交互的0/1类型时(十六进制55),每十六进制55个字节产生一个18脉冲噪声,增加起始和终止位,并且连续的字节产生更长的脉冲。

PC的串口以38,400 bps的标准传输速率产生38.4kHz数据的精确脉冲,带有简单频率加倍装置和两个IR LED

  接收器需要10到70个脉冲序列,脉冲之间间歇近似相等;这种设置容易满足需求。虽然由于起始和终止位,每两个脉冲传输一个字节,但是可以通过发

送十六进制的0字节产生短停顿。然而,接收器消除了这些脉冲。停止传输一段时间会产生更长的脉冲。必须依靠使用的接收器,偶尔插入更长的停顿。可以通过使用短和长脉冲和合适的协议,实现数据传输。

  如图1电路形成带串口和电容输出阻抗的高通滤波器。正脉冲驱动一个IR LED;负脉冲驱动另一个IR LED。两个LED都应指向接收器。PC端口通常提供最大5到20 mA电流和±15V电压,因此输出电阻小于千欧级。限流电阻通常不是必需的。大多数情况下,1到10nF电容值就可以工作了。接收器是有余量的。对非PC端口,如有低阻抗的微处理器,需要调整电容值。实际应用中,如果将LED指向接收器,用最小5mA的高LED电流可靠地实现2到4米的输出距离。简单的PC编程是可用的。

  英文原文:

  Achieve simple IR-data transmission from a PC’s serial port

  By transmitting appropriate hex values from a PC's serial port to a pair of IR LEDs, a remote-control IR receiver can enable 38.4-kHz data transmission.

  Andreas Grün, Wedemark, Germany; Edited by Charles H Small and Fran Granville -- EDN, 10/11/2007

  Often, you need to transmit a couple of bits or bytes of data to a microcontroller without a direct cable connection. One simple way to achieve this goal is to use a widely available IR receiver, such as a TSOP17xx or similar receiver from Vishay that finds use in IR-remote-control applications, such as TVs and VCRs. These devices are easy to implement because they require no external parts. These receivers usually work with a pulsed 38-kHz carrier and include an amplifier, automatic gain control, and a demodulator.

  The main problem for simple applications is building the transmitter, which requires a 38 kHz start-stop oscillator, additional supply voltage, and modulating pulses in the millisecond and submillisecond range. These factors are difficult to control with PC operating systems. On the other hand, a PC’s serial port at a standard transmission rate of 38,400 bps can generate precise bursts of 38.4-kHz data with a simple frequency doubler and two IR LEDs (Figure 1). When transmitting bytes with an alternating zero/one pattern (hex 55), each hex-55 byte generates a burst of 18 pulses, adding the start and stop bit, and consecutive bytes can generate longer pulses.

1】【2
加载中

对文章的评论

剩余字数:  

浏览该文章的用户还看过...

  • 文 章

  • 论 坛

  • 博 客

  • 小 组

设计资源与分销