logo       Dave's Online Memory
xctl - transmitter control program for openbsd You: 38.103.63.58 Friday Dec 5, 2008 12:32AM PST

Here's a quick 'n dirty program to send arbitrary values to the parallel/printer/lpt port on a pc. It was written on and for an openbsd box that will be used to control the radio transmitter for Ithaca Radio. The parallel port will connect to a couple of relays to mute the audio, and select between alternate input signals.

It has some normal defaults, so use should be pretty straightforward. In a nutshell:

xctl [-h|-?] [-p port] [value]

-h or -? prints a short usage message.

port is the port to send the byte to. It defaults to 0x378.

value is the byte to send. It defaults to 0.

Examples:

xctl -h
prints the help screen.
xctl
sends a 0 to port 378 (hex).
xctl 3
sends a 3 to port 378 (hex).
xctl -p 278 13
sends a 13 to port 278 (hex).

Oh, by the way... Either a feature or bug, but it will only allow the default ports of 378, 278, and 3bc to be specified.

  • file icon Here's the source code: xctl.c
  • file icon ...a precompiled binary that was built and tested (a little) on a x586 running 3.2: xctl
  • file icon ...a precompiled binary that was built and tested on a x686 running 4.3: xctl43
  • file icon The circuit's pretty simple; I've built variations on this theme for years: relay.ps
electrical schematic

enjoy!
...dave

...dave


silly cat image Top of Page FEEDBACK      Comments, Corrections & Questions welcome