You should have no trouble finding one or more of the thousands of examples of
bit-banging a serial interface that have been published over the years. A
GOOGLE search for "software UART" produces lots of hits.
It's not rocket science. Keep in mind that with asynchronous communications,
you need to remain within one bit-time over the course of, at most, 11 bits,
of which the first and last are start and stop bits, respectively. If you
stick with 7-bit ascii, you have more margin. Each time you start, you start
anew, so there's no cumulative timing error over more than one character. If
you don't mind the code size, you can time this VERY well regardless of the
main oscillator frequency, since you can make minor adjustments between bits.
It's normal, BTW, to sample at the middle of a bit window. (someone had to
point that out to me once ... but only once ... )
The Z80 computes parity in the PSW, though there's some sort of gotcha with
that, if my feeble memory serves.
good lluck.
Dick
----- Original Message -----
From: "Stan Barr" <stanb(a)dial.pipex.com>
To: <classiccmp(a)classiccmp.org>
Sent: Sunday, March 24, 2002 2:43 AM
Subject: Re: ZX81 software serial port (was Re: ZX81 I/O ports)
Hi,
"Glen Goodwin" <acme_ent(a)bellsouth.net> said:
From:
Stan Barr <stanb(a)dial.pipex.com>
Hmm...I did my ZX81 serial port in software! It
was only used to
transfer data to the host computer, so it was pretty simple...
Stan, I would really appreciate it if you would share this solution with
me, assuming you still have the code.
Sorry, I can't find *any* of my ZX-81 software ;-( There's a folder
somewhere with all my notes and listings in, but where?? (I've got
way too much junk!)
It drove an 8255 port using a mixture of Forth and assembler code I
filched from a book. Only ran at about 110 bps, but it was enough
for what I was doing.
These days, I'd probably just hitch up a standard UART...
--
Cheers,
Stan Barr stanb(a)dial.pipex.com
The future was never like this!