"James Reed" <[EMAIL PROTECTED]> wrote:

> I am attempting to run HAL without the use of EMC2. As I have stated 
> before, I want a DRO only at this point in time, and am not interested in 
> the extras EMC offers. 
> 
> I have successfully run HAL as an internal (to the computer) program (using 
> the function generator in the HAL tutorial and a couple of comparators 
> instead of the parport quadrature input). HOWEVER, when I try real hardware 
> and the parport, I neet 40mA at 5 volts to drive a pin high. This usually 
> indicates the port it configured for output still. 

Which pin?  Sorry if I'm repeating stuff you already know, but I'm just
making sure.  Pins 2-9 can be configured as inputs or outputs.  Pins 10,
11, 12, 13, and 15 are always inputs.  And pins 1, 14, 16, and 17 are
(almost) always ouputs.

To use pins 2-9 as inputs, you need to specify "i" or "in" in the config
string when you load the driver.

To use pins 1, 14, 16, and 17 as inputs, you first need a parport that
supports it, not all do.  Then you need to specify "x" in the config
string.  And finally, you need to set the corresponding outputs high.
The ports that support input on those pins do so by using open-collector
drivers that can pull down but not up.  If you set them high, there is
an internal pullup resistor that pulls the pin high, but it can be
overcome by an external source to read a low input.  You should not
attempt to force these pins high if they are being driven low.
Using pins 1, 14, 16, and 17 as inputs should be considered experimental.
I don't think it is supported at all in version 2.0.x, so unless you are
running code from CVS, ignore this entire paragraph.

> My question is this? When in the program does parport get initialized to 
> inputs, and how do I make sure it is initialized before I try to drive it? 

The direction of pins 2-9 is set when the parport.N.write is executed.
So you must "addf" it to a realtime thread, and start the thread, even
if you don't intend to use any outputs.

(This might be a bug - I will look into setting the port direction as
soon as the driver is loaded.)

> Thanks for your help. 

Hope this is usefull, let us know what you find out.

Good luck,

John Kasunich

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to