How do you know that using a parallel port is the _only_
I'm sure you could do it by manually pushing individual electrons
around if you really wanted to.
What platform are you talking about?
How do _you_ use a _parallel_ port to send _serial_ data?
Bit twiddling and timing. ANSI C doesn't provide a way to do the
timing, unless you experiment with time-waster loops. If the bits
to be twiddled are memory-mapped, that's doable, but it takes some
system-specific magic to figure out where the bits to be twiddled
are.
Somewhere I have documentation on how simple hardware (much
simpler than a modern parallel port) was used on a PDP-8 to
send and receive data to a bunch (the PDP-8 had a 12-bit word,
so maybe it handled 12 teletypes per card) of teletypes all at once,
implementing a "software UART" function.
A modern RS-232 async serial port with a hardware UART (something
you connect to serial mouses, modems, etc., and I think this is
largely independent of platform as long as it's not one from the
embedded-architecture gang) is probably not adequate for what the
OP wants:
1. The clock line required isn't necessarily provided off-chip.
2. UARTs provide characters with start-stop bits in formats that
THEY happen to like. (8 and 7-bit characters are common, 6 and
5-bit characters are sometimes available, and 13-bit characters
(which, as I recall, was actually used on some kind of military
radar system) are very difficult to find. If you want NO start or
stop bits, and just quit clocking when you have no more data for
the moment, an async serial port is likely to be worse than nothing.
<off-topic>
A serial EEPROM interface has at least 3 lines, a serial
in (SI), serial out (SO) and a clock (CLK). The purpose
of the clock line is to latch the value of the SI line
into the chip or the SO line out of the chip. If these
lines are memory-mapped than the processor can directly
access these without having to use a port. This is
one instance where a parallel port is not needed.
In effect, what you are describing *IS* a parallel port.
One bit in, two bits out, and memory-mapped. You could
probably control 4 of these interfaces with one modern
parallel printer port.
</off-topic>
When making a statment like "... the only way", please
include more information that backs up, or proves your
statement.
Gordon L. Burditt