From Newsgroup: comp.sys.ibm.ps2.hardware
On 8/8/26 09:12, MEK wrote:
Parralel Plug Male-a ===wires=====, Ardiuno Nano with display
is it worth it? ideas??
the AI seems to do a good job writing the sketch AKA code
link to the Ardiuno
https://www.aliexpress.com/item/1005006990745594.html
the AI code
The specialized Nano V3.0 ATmega328P CH340C development board with an integrated 0.91" 128x32 OLED display is completely perfect for this
project. [1, 2]
Because your specific screen is shorter than the standard 128x64
displays (32 pixels tall instead of 64), the code layout has been
completely redesigned to fit into a sleek, wide-screen horizontal row dashboard. The layout splits your 128-pixel width to display a large
Current Code on the left and a 2-step rolling History Log on the right.
[1, 2]
## Efo# Custom Structural Wiring Guide
Since the OLED display is routed entirely inside the board's internal
PCB traces (A4 and A5), you only need to run wires from your DB25
parallel port and your physical reset button directly into the side pin headers. [2, 3]
roiroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroE
roe IBM PS/2 DB25 PORT roe
rooroCro4roCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCro4roCroy
roe Pin 1 (-STROBE) roe Pin 18-25 (GND)
roe roe
ru+ ru+
roiroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroE
roe NANO V3.0 + 0.91" OLED roe roCroCroCru| [ 128x32 Screen Onboard ]
rooroCro4roCroCro4roCroCro4roCroCro4roCroCro4roCroCro4roCroCro4roCroCro4roCroy
roe roe roe roe roe roe roe roe Parallel Data Lines:
roe roe roe roe roe roe roe rooroCroC D11 <roCroCroC DB25 Pin 9 (Data 7 - MSB)
roe roe roe roe roe roe rooroCroCroCroCroC D10 <roCroCroC DB25 Pin 8 (Data 6)
roe roe roe roe roe rooroCroCroCroCroCroCroCroC D9 <roCroCroC DB25 Pin 7 (Data 5)
roe roe roe roe rooroCroCroCroCroCroCroCroCroCroCroC D8 <roCroCroC DB25 Pin 6 (Data 4)
roe roe roe rooroCroCroCroCroCroCroCroCroCroCroCroCroCroC D7 <roCroCroC DB25 Pin 5 (Data 3)
roe roe rooroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroC D6 <roCroCroC DB25 Pin 4 (Data 2)
roe rooroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroC D5 <roCroCroC DB25 Pin 3 (Data 1)
rooroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroCroC D4 <roCroCroC DB25 Pin 2 (Data 0 - LSB)
## 1. DB25 to Nano V3 Pins
* DB25 Pin 1 (-STROBE) roCroCroC> Arduino D2 (Parallel Data Interrupt Clock)
* DB25 Pin 2 (Data 0) roCroCroC> Arduino D4
* DB25 Pin 3 (Data 1) roCroCroC> Arduino D5
* DB25 Pin 4 (Data 2) roCroCroC> Arduino D6
* DB25 Pin 5 (Data 3) roCroCroC> Arduino D7
* DB25 Pin 6 (Data 4) roCroCroC> Arduino D8
* DB25 Pin 7 (Data 5) roCroCroC> Arduino D9
* DB25 Pin 8 (Data 6) roCroCroC> Arduino D10
* DB25 Pin 9 (Data 7) roCroCroC> Arduino D11
* DB25 Pins 18 to 25 (GND) roCroCroC> Arduino GND
## 2. Physical Reset Button [4]
* Terminal A roCroCroC> Arduino D3 (Manual Clear Interrupt)
* Terminal B roCroCroC> Arduino GND [5]
------------------------------
## EfA+ Optimized 128x32 Production Source Code
Click the Copy button to capture this code. It updates the
initialization parameters specifically for the 128X32_NONAME SSD1306
driver profile and fits font scaling cleanly within a 32-pixel height restriction. [1, 2, 6]
#include <Arduino.h>#include <U8g2lib.h>#include <Wire.h>
// Initialize specific Onboard 0.91" 128x32 OLED (SSD1306) via Hardware I2CU8g2_SSD1306_128X32_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
// Signal Tracking I/O Pin Mapsconst int dataPins[] = {4, 5, 6, 7, 8, 9,
10, 11}; // Parallel Bus: D4=Data0 to D11=Data7const int strobePin = 2;
// Interrupt: PS/2 Strobe Line (-STROBE)const
int resetPin = 3; // Interrupt: Manual Reset Pushbutton
// Volatile Shared System Flags (Handled inside Hardware ISRs)volatile
byte currentPostCode = 0x00;volatile bool dataReceived =
false;volatile bool resetTriggered = false;
// History Stack (Truncated to 3 entries total due to 32px vertical height)byte historyLog[] = {0x00, 0x00, 0x00};int uniqueCodeCount = 0;
// Interrupt Service Routine: Fires when IBM PS/2 commits a byte write
cycle to the portvoid capturePostCode() {
byte tempByte = 0;
for (int i = 0; i < 8; i++) {
if (digitalRead(dataPins[i]) == HIGH) {
tempByte |= (1 << i);
}
}
// Filter out immediate bouncing duplicate readings
if (tempByte != currentPostCode || uniqueCodeCount == 0) {
currentPostCode = tempByte;
dataReceived = true;
}
}
// Interrupt Service Routine: Instantly flags manual clear event void handleReset() {
resetTriggered = true;
}
// UI Panel: Clears and prints standard standby graphic to the
widescreen interfacevoid drawSplashScreen() {
u8g2.clearBuffer();
u8g2.setFont(u8g2_font_6x10_tf);
u8g2.drawStr(4, 14, "IBM PS/2 POST READ");
u8g2.setFont(u8g2_font_5x7_tf);
u8g2.drawStr(4, 28, "Waiting for data...");
u8g2.sendBuffer();
}
void setup() {
u8g2.begin();
// Initialize parallel port bus inputs
for (int i = 0; i < 8; i++) {
pinMode(dataPins[i], INPUT);
}
pinMode(strobePin, INPUT);
pinMode(resetPin, INPUT_PULLUP); // Keeps pin high until button
shorts it to ground
// Bind live system tracking loops directly to hardware pins
attachInterrupt(digitalPinToInterrupt(strobePin), capturePostCode, FALLING);
attachInterrupt(digitalPinToInterrupt(resetPin), handleReset,
FALLING);
drawSplashScreen();
}
void loop() {
// Execute System State Wipe
if (resetTriggered) {
resetTriggered = false;
dataReceived = false;
currentPostCode = 0x00;
uniqueCodeCount = 0;
for (int i = 0; i < 3; i++) {
historyLog[i] = 0x00;
}
drawSplashScreen();
}
// Execute Layout Processing for Incoming Codes
if (dataReceived) {
dataReceived = false;
// Step old tracking variables down history levels
for (int i = 2; i > 0; i--) {
historyLog[i] = historyLog[i - 1];
}
historyLog[0] = currentPostCode;
if (uniqueCodeCount < 3) {
uniqueCodeCount++;
}
// Draw Wide Dashboard GUI Grid
u8g2.clearBuffer();
u8g2.drawFrame(0, 0, 128, 32); // Outer bounding board frame
u8g2.drawVLine(56, 0, 32); // Split Primary View from History
View
u8g2.drawVLine(92, 0, 32); // Split History Slot 1 from
History Slot 2
// --- PANEL 1: CURRENT ACTIVE POST CODE (Left Section) ---
u8g2.setFont(u8g2_font_4x6_tf);
u8g2.drawStr(4, 7, "CURRENT");
u8g2.setFont(u8g2_font_logisoso16_tf); // Clean, sharp mid-scale font
char currentHexStr[3];
sprintf(currentHexStr, "%02X", historyLog[0]);
u8g2.drawStr(14, 26, currentHexStr);
// --- PANEL 2: HISTORY -1 CODE AGO (Middle Section) ---
u8g2.setFont(u8g2_font_4x6_tf);
u8g2.drawStr(60, 7, "LAST -1");
u8g2.setFont(u8g2_font_6x12_tf);
char hist1Str[3];
if (uniqueCodeCount > 1) {
sprintf(hist1Str, "%02X", historyLog[1]);
u8g2.drawStr(68, 23, hist1Str);
} else {
u8g2.drawStr(70, 23, "--");
}
// --- PANEL 3: HISTORY -2 CODES AGO (Right Section) ---
u8g2.setFont(u8g2_font_4x6_tf);
u8g2.drawStr(96, 7, "LAST -2");
char hist2Str[3];
if (uniqueCodeCount > 2) {
sprintf(hist2Str, "%02X", historyLog[2]);
u8g2.drawStr(104, 23, hist2Str);
} else {
u8g2.drawStr(106, 23, "--");
}
u8g2.sendBuffer(); // Dispatch complete render payload to screen
}
}
## EfA+ Flashing settings for the Arduino IDE
When uploading this code to your specific CH340C/ATmega328P variant, use
the following settings inside the Tools menu: [1, 7, 8]
* Board: Arduino AVR Boards -> Arduino Nano
* Processor: ATmega328P (Note: If the upload hangs or fails instantly,
switch this setting to ATmega328P (Old Bootloader), as many budget clone
chips use the older flashing speeds).
* Port: Choose the active COM port assigned to the CH340 chip. [1, 2, 8,
9, 10]
no affiliations
--
Moussa
"People alike with a similar circumstances, tend to find each
others across space and time, given enough time in life, no
matter distance, language, race, colour and believes" (c) MEK
*** Do Not Copy, Duplicate or Use without my Permission ***
--- Synchronet 3.22a-Linux NewsLink 1.2