Open Drain

王朝厨房·作者佚名  2007-01-05
宽屏版  字体: |||超大  

摘要:Open Drain

A kind of PAD.

Can perform wire-AND function, it was called open-collector in Biploar.

How do I describe an open-drain, bidirectional I/O pin?

Q:

I am trying to build a ps/2 mouse interface for the xs40. I have been relying on http://panda.cs.ndsu.nodak.edu/~achapwes/PICmicro/PS2/ps2.htm for specs of the protocol, and I am now trying to build the open- drain collector shown on this page for the bidirectional I/O. (pullup -> transistor -> gnd). How do I do this?

A:

You can do an open-drain output like this:

ps: inout std_logic;

...

ps <= '0' when data='0' else 'Z';

u0: pullup port map(O=>ps);

The first statement declares a port which can be used as an input or output. The next statement pulls the ps output low if a logic 0 is being driven, but places the output in a high-impedance state if a logic '1' is being driven. The second statement attaches an internal pull-up resistor to the output pin. You might also use an external pullup resistor since the internal pullups are around 100 Kohms. You may need an explicit component declaration for the pullup as well:

component pullup -- pullup component port( O: out std_logic ); end component;

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
© 2005- 王朝网络 版权所有