Oops. Correction.
The 245 DIR signal needs to be LOW for typical operation (output to the
port). We would need to invert the online signal for it to be in that
default mode from the pull up resistor.
On 10/11/2025 10:10 PM, Scott McDonnell wrote:
ok. I think maybe I have this worked out. Maybe. Please correct me
where I may be wrong.
OE and DIR would best be controlled externally since the software
isn't going to know when the device wants to transmit or receive.
So, I read over the description of how the printer port interacts with
a printer a couple of times.
The M100 looks for the BUSY signal. If it is low, then data is sent to
the printer. This would work well as the OE signal of our 245. When
the printer is not busy, the 245 is active and allows data to pass.
When it is busy, it is tri-stated. This line is pulled up inside the
M100 which would disable the 245 and not allow Port A bus activity to
reach the connector when either the printer is busy or nothing is
attached to the printer port.
We can then control this line ourselves with our external device.
For direction, we need to set the DIR pin on 245 and ALSO let the
computer know that we want to transmit something. The other input is
ONLINE. We could use this pin to control direction.
The information seems a little sketchy for the operation of this
signal. It is pulled up inside of the computer, so I assume that the
printer needs to pull it low. But it is not clear if it is low when
online or offline.
However, the internal pull up if connected to the 245 DIR pin sets it
for output which is the default state. If the printer being ONLINE
keeps this high, then normal operation is possible.
But for non-printer use, we can drive this pin from our own peripheral
to indicate direction. And since we can read this pin, our software
will know whether we are reading or writing data. The 8155 mode for
Port A has to be changed from output to input to read anyway.
Seem pretty solid. Now, I don't know if the computer will go insane
with data coming in on PORTA, but I don't think so. At least not when
it isn't accessing the keyboard or LCD. Software to use this mode
would have to be tightly controlled.
Of course, what this does not do is give us bit level direction
control so it is not truly bi-directional like a modern parallel port.
All 8 pins are either inputs or outputs. But if this works, it is a
fairly simple mod.
Thoughts?
On 10/11/2025 5:41 PM, Scott McDonnell wrote:
So, I have been looking into what mods would be needed to make the
printer port bidrectional.
Looking at the schematic, the printer port data bus is shared with
the LCD and keyboard. It appears that the 244 chip used on the
printer port is always enabled, unlike the one for the LCD and
keyboard. So, I assume that it is always outputting any time there is
activity on the bus?
From the service manual, the communication with a printer is
controlled via the strobe and busy lines. Of course, that is only
really true when using the print function, not direct port manipulation.
Since the '244 is not addressable, there isn't really an I/O address
assigned to it other than the strobe signal at E0H-EFH.
The 8155 chip used is already bidrectional, so all we really need is
a bidirectional bus driver.
Replacing the '244 with a '245 would be drop in. The direction pin
becomes pin 1 (/1G on the 244) and the Output Enable becomes /2G.
OE would become a chip select and the direction pin would just be A0.
This would be a straightforward mod if the printer port were
addressable.
Am I missing something? Maybe we could derive the chip select from
the strobe?
The references I am finding really only talk about printing from this
port and aren't really talking about low level programming.
Anyone else look into this?
Scott