Re: Control device using TTL level signals DoN. Nichols wrote:
>> Anyone know what would be involved to write to the parallel port so I
>> can set the outputs to some precise values I want and keep them there
>> until I want to change them?
>
> man bpp
>
> man ecpp
>
> Verify which is supported on your system.
>
> and pay particular attention to the IOCTLs documented.
Thanks for that, although I still cant see how to do this from the ecpp
man page. There are plenty of structures defined in that man page, but I
don't see what actually writes the data. Perhaps I am being thick!
We eventually found on eBay a GPIB controlled relay (actually 6
reed-relays in a box) so bought a couple of them for $60 the pair. Since
GPIB is going to be used to set up some test equipment, having a GPIB
card is not excessive for this.
But I would like to know how to use the parallel port.
>
> And as long as nothing else has to use that port, chown it to
> belong to a process which your program runs as and you won't have to run
> it as root.
Cheers. Nothing else needs to use it. I'm basically setting up a couple
of Suns to just run the test equipment.
I just spent 15 minutes trying to understand why I could not read my
GPIB controlled DVM, only to realise I'd connected the GPIB cable on the
Sun, but did not connect the other end to the DVM! Once that was sorted
out, I can read the DVM ok from a simple C program.
> Note that it will be a symlink to another /devices entry and
> that will be the one which you will have to chown. Actually, by
> default, mine is crw-rw-rw- so if you only need to access it, and don't
> have to worry about others trying to access it and conflict with what
> you are doing, you don't need to change anything.
>
> FWWI Mine has /dev/ecpp0 and does not have /dev/bpp0
Same here - /dev/ecpp0 but no /dev/bpp0
I think I have a recollection that bpp0 is for older machines - I
suspect my SPARC 20 has that.
>
>> My guess is that this will be very difficult to do, but I don't know.
>
> Not that hard, once you learn to use IOCTLs.
>
>> If anyone has any suggestions to how to get some TTL level signals from
>> a Sun I would be intersted. The Sun will have a GPIB board in it too,
>> but I cant find any cheap GPIB controlled switches.
>
> You could also pick up one of the older serial port chips
> (separate I/O buses and status bits) and send characters to it to set
> particular bits high or low. If you need a lot of them, use the 8 bits
> and decode them into 128 addresses and a bit for "set high" or "set
> low".
>
> Enjoy,
> DoN.
> |