First post, by mkarcher
I successfully added PS/2 support to Disruptor's Shuttle HOT433 (rev 1, 2 or 3) mainboard (using an external KBC). This post is a detailed explanation on what needs to be modified on the board to switch it to external keyboard controller support, and suggests a BIOS image that can be used as base.
About the keyboard options of the UM8886
Integrated keyboard port
The UM8886 south bridge (commonly paired with the UM8881 north bridge on 486 boards) has an integrated keyboard controller, including PS/2 mouse support. It uses mulifunction pins for the keyboard and mouse interface. In this post, I am not going to use the integrated PS/2 mouse support of the UM8886, because the traces needed for that are not available on the Shuttle HOT433, and modding that board for support of the integrated PS/2 mouse support would be a tedious and delicate task.
The keyboard interface part of the integrated keyboard controller is combined with control pins for the external keyboard controller. The following pins of the UM8886 are relevant for the keyboard interface (integrated KBC) or keyboard controller interface (external KBC), the color code is the color I use in the images to highlight traces connected to that pin. No worries for color-blind people, I will also explain the connections in readable text:
Pin nr IntKBC ExtKBC Color code
55 Keylock Keyboard controller clock dark brown
56 Kbd Data CPU reset from keyboard controller green
57 Kbd Clock A20 gate from keyboard controller yellow
58 /ROMCS * /KBDCS in both modes, also configuration strap hot pink
As you see, pins 55 to 57 change to completely different functions when you switch between internal and external keyboard controller mode. Not even the direction of those pins stays the same. In internal KBC mode, pin 55 is an input pin (5V = keyboard unlocked, 0V = keyboard locked), whereas pin 56 and 57 are high-drive open-collector bidirectional pins that can be directly connected on the DIN or PS/2 connector without any buffer chip. In external KBC mode, pin 55 is an output pin, carrying the processor clock for the keyboard controller (around 8MHz), whereas pins 56 and 57 get input pins for system control signals that originate from the keyboard controller.
Pin 58 does not change its function, but still a very important dual-purpose pin. It's primary purpose is to be a chip select signal for both the ROM BIOS chip as well as the keyboard controller. UMC pulled a clever trick here, because both the keyboard controller and the ROM BIOS only actually do something if their chip select signal is combined with a second signal. This second signal is "memory read" or "memory write" for the BIOS chip (obviously, write is only useful on flash parts), whereas the second signal is "I/O read" or "I/O write" for the keyboard controller. So the keyboard controller and the ROM BIOS chip can always be selected at the same time, but the ROM chip only responds on memory cycles, and the keyboard controller only responds on I/O cycles. The secondary function of Pin 58 is the most important function of this whole post: It's a configuration strap that tells the UM8886 whether the internal keyboard controller is to be enabled or disabled. If this pin is pulled high at power-up, the internal keyboard controller is enabled, and Pins 55-57 have the function listed in the second column of the table above. If pn 58 is pulled low at power-up, the internal keyboard controller is disabled, and Pins 55-57 have the function listed in the third column of the table. I wasted some time trying to find a PCI configuration space bit to toggle between internal and external KBC mode - just to find out that there seems to be none.
Integrated mouse port
While this post is not about the integrated PS/2 interface, I also reverse engineered something about the PS/2 port. I will write down the results in this paragraph, but you can skip until the next heading for the main point of this post.
The PS/2 mouse interface is multiplexed on pins used for the "ISA unlatched high address lines". These address lines are introduced with the 16-bit ISA extension of the IBM AT and present the address for the next cycle quite early (possibly even when the previous cycle is just about to be finished), and are not necessarily valid over the whole bus cycle. The primary purpose of LA17-LA19 is allowing 16-bit ISA plugin cards to signal their capability of handling a 16-bit cycle. This is used by 16-bit VGA cards for video memory access if they detect LA17-LA19 having the pattern 1,0,1 (which translates to the address range A000:0 to B000:FFFF). To allow zero-waitstate 16 bit memory writes, the MEMCS16 and 0WS pins need to be driven before the old-fashioned SA17-SA19 lines are guaranteed to be valid. The high address lines (to extend ISA from 1MB to 16MB address range) are also only presented as unlatched lines LA20 to LA23, and they need to be decoded by cards responding to past-1MB writes. The following pins change their function depending on enabling the internal PS/2 port:
Pin nr Mouse port on Mouse port off
198 unknown LA19
199 Mouse Data LA18
200 Mouse Clock LA17
On the Biostar 8433UUD board, which uses the integrated mouse port of the UM8886 south bridge, the connections of pin 198 to 200 can be reassigned to either the ISA LAx pins or the mouse port pins by moving a soldered resistor network (of the 4*0Ohm type). The specific 8433UUD I have at hand obviously has the resistor network soldered at the position that connects these pins to the PS/2 mouse port. The ISA pins LA17 to LA19 are driven from SA17 to SA19 instead. My guess it that this reduces ISA compatibility with 16-bit cards, because you can not drive LA17-LA19 and SA17-SA19 from the same pin without violating some ISA timing specification, but I did not yet get around to do thorough ISA tests (like testing 0WS ET4000 ISA graphics cards) on the UMC board.
Analysis of the PCB traces on the HOT433
Pinout of the sockets / the mouse pin header
As feipoa already noticed, the assignment of PS/2 mouse port pins to the UMC south bridge is "weird". This is a side effect of a strange choice about what 0-ohm jumper links are configured on the board as sold. I am going to show photos of relevant parts of the board (some from the back, just to show the traces; some from the front to show SMD components) to explain what needs to be modified. The relevant traces are color-coded, an I am also explaining them in plain text for color-blind readers.
Let's start with the pins at the keyboard and mouse ports. The pinout of those ports are well-known, so identifying the traces is straight-forward. I use the following color-code:
Keyboard Clock saturated red
Keyboard Data light red
Mouse Clock saturated blue
Mouse Data light blue
+5V white
GND black
This part shows the traces from the keyboard port and the 10-pin header for the mouse (pin 1 is at the top right corner, pin 2 at the top left corner, pin 10 at the lower left corner) going towards the keyboard controller. It connects the standard pins from the DIN socket (and the soldering pads for the alternate option for a PS/2 keybord socket at the same place) to some vias that connect to very import zero-ohm resistors shown in the next picture. The pinout of the 10-pin mouse header ist like this:
- Pin 2: GND
- Pin 3: Mouse data
- Pin 5: +5V
- Pin 10: Mouse clock
Except for the red and blue wires from the port, the top right corner also shows a yellow and a green trace. These traces are directly connected to the chipset pins listed in the first table.
pull-up and "configuration" resistors between the sockets and the super I/O chip
On the other side at the board, you find the following layout:
This picture shows the L/C filters for the keyboard and mouse clock and data lines (where no attempt is mode to use different colors for the "external" and "internal" side of the L/C filters). This picture also shows the pull-up resistors for the clock and data lines. Keyboard clock is filtered by C2/L2 and pulled up by R4, keyboard data is filtered by C5/L5 and pulled up by R5, mouse clock is filtered by C4/L4 and pulled up by R2, finally mouse data is filtered by C3/L1 and pulled up by R3. Notice the white color-code (for +5V) on the opposite end of the pull-up resistors.
If no external keyboard controller is present, keyboard clock and keyboard data need to be directly connected to the yellow-coded and green-coded line from the chipset. This is achieved by R6 and R8. If you want to use an external keyboard controller, remove R6 and R8. R7 is a kludge for an external AT keyboard controller without PS/2 mouse support. An AT keyboard controller has the keyboard data line connected to Pin 39, whereas a PS/2 keyboard controller has the mouse clock at the same pin. So the purpose of R7 is to connect the keyboard data line (light red) to the correct pin of an AT keyboard controller. As the goal is to install a PS/2 keyboard controller with mouse support, remove R7.
Interesting pins at the keyboard controller
Pins that are relevant to understand the modification are (at the keyboard controller):
- Pin 1 is keyboard clock input to the KBC, color coded saturated red
- Pin 3 is controller clock input (~8MHz) to the KBC, color coded light brown
- Pin 6 is chips select to the KBC, color coded hot pink (shared with BIOS chip select, as explained above)
- Pin 21 is CPU reset output from the KBC, color coded green
- Pin 22 is A20 gate output from the KBC, color coded yellow
- Pin 27 is keyboard data input to the (PS/2) KBC, color coded light red
- Pin 28 is mouse data input to the (PS/2) KBC, color coded light blue
- Pin 34 is keylock input to the KBC, color coded orange
- Pin 39 is mouse clock input to the (PS/2) KBC, color coded saturated blue (an AT KBC has keyboard data on this pin; if you use an AT KBC, you need R7 to bridge keyboard data input into this pin.
Configuration area next to the 7406 socket
The 7406 socket needs to be fitted with an 7406. The 8042 keyboard controller chip is not able to drive a long keyboard cable, so it needs an external ampliefer. The most simple kind of digital amplifier is an inverter. The 7404, 7405 and 7406 all are inverter chips (containing 6 inverters), but only the 7405 and the 7406 are so-called open-collector inverters (they pull the signal low if needs to be low, but they don't do anything if the signal should be high). The keyboard interface relies on this behaviour to enable bidirectional communication. If neither the keyboard nor the 7406 on the mainboard pull the signal low, it is pulled high by the corrensponding pullup resistor on the mainboard. If either device pulls the signal low, it pulls much stronger than the pull-up resistor, so the signal appears low. The 7406 is a much stronger inverter than the 7405 (it can pull down more current, so it can (dis)charge the keyboard cable faster), so the keyboard interface uses the 7406. Only 4 of the 6 inverters are used (two for the mouse interface, two for the keyboard interface), in case of the HOT433, the inverters at pin 1 and 2, at pin 3 and 4, at pin 5 and 6, as well as the inverter at pin 9 and 8 are used. The inverters at pins 11 and 10 as well pins 13 and 12 are unused. The traces from the keyboard controller output to the 7406 sockets are not shown in my pictures, because they follow the standard PS/2 keyboard controller layout and don't help in understanding how this specific board works.
Next to the 7406 sockets, you find the following components:
In this picture, the following connections are visible:
- Keylock (connected to the keylock pin at the front panel connectors and pin 34 of the keyboard controller, color coded orange, is connected to the right side of R30.
- Keyboard controller clock (connected to pin 3 of the keyboard controller, color coded light brown) is connected to the left side of R29
- The multi-function pin for keylock or keyboard controller clock from the chipset (color coded dark brown), is connected to the right side of R29 and the left side of R30. The function of R29 (33 Ohms) is to absorb reflections of the the clock signal that might arise at the keyboard controller or its socket. This is called "series termination".
- Keyboard Controller/ROM chip select (color coded hot pink) is connected to the right pad of R20 (10 kOhm) and to the left pad of R24 (inentionally absent)
- the left pad of R20 is connected to +5V (color coded white)
- the right pad of R24 is connected to GND (color coded black)
If an external keyboard controller is to be used, the chipset does no longer need to receive the keylock signal, but it starts outputting the clock signal for the keyboard controller on the corresponding multifunction pin. Thus the dark brown line now is keyboard controller clock and needs to be disconnected from the keylock signal. Remove R30. Also, as explained in the introduction, the UM8886 needs to know that an external keyboard controller is present, so the keyboard controller/ROM chip select signal no longer needs to be pulled up (through R20), but it needs to be pulled down (through R24). So remove R20 and place the resistor on the R24 pads instead.
BIOS
You need a BIOS with enabled PS/2 mouse support. I recommend using the bios with the identifier string 2A4X5H21, as posted in this thread Newer AWARD Bios for HOT-433?, as it seems to be based on a quite recent revision of the Award 4.51 core. This BIOS has PS/2 mouse support disabled through a configuration bit which can be changed by MODBIN on the "installed options" page. I did so to obtain this image:
You need to flash this BIOS and enable "PS/2 mouse function" in the advanced BIOS setup options page to obtain a working PS/2 port.
Keyboard controller
You need (obviously) a PS/2 compatible keyboard controller. In this case, it's a MEGAKEY taken from a dead donor board. These 8042 controllers contain an internal oscillator that outputs pulses on pin 2, and expect to excite a crystal in resonance that is connected between pins 2 and 3. The signal that comes back on pin 3 is used as system clock and as reference to create excitation pulses on pin 2 at the right frequency. If you want to clock the keyboard controller from an external clock (as these mainboards do), you just feed the clock into pin 3, while pin 2 should be left alone. The shuttle HOT-433 seems to have a supply rail connected to that pin right at the socket, so the excitation pulse output of the keyboard controller is shorted to ground (or +5V). This is not nice towards the keyboard controller and should be avoided (but it would most likely work anyway). I dealt with this problem by bending pin 2 upwards, so it stays next to the socket instead of being inserted.
Summary
So, in a TL;DR manner: To enable the PS/2 mouse port on your HOT433 boards, do the following tasks:
- Remove R6-R8 (0-Ohm resistors next to the PS/2 mouse pin header)
- Remove R30 (0-Ohm resistor near the 7406 socket)
- Move the 10kOhm resistor (marking code "103") from R20 to R24. Originally, R24 is absent, after the mod, R20 is absent.
- Plug a 7406 chip into the empty socket marked 7406 (between the ISA slots)
- Plug a PS/2 compatible keyboard controller into the empty socket marked 8042. Preferably avoid contacting pin 2 by pending this pin out of the socket.
- Flash a BIOS with PS/2 mouse support enabled, for example the one included in this post
EDIT: Added the story about bending the clock oscillator output pin.
To undo the modification, revert all the changes, except you don't have to re-install R7.