ADJUSTED RESISTOR VALUES FOR MOSFET SWITCHES
The voltage divider network hidden inside the IBM 1130 logic, specifically the switch debouncing circuits, required a much smaller resistor on my MOSFET switches to produce logic low and logic high levels on the gates fed by the signal. I changed over to 470 ohm resistors for the three switches that work with 12V.
The switch that drives the -TWR CB RESPONSE signal has to deliver 48V when active and that voltage sinks to ground through the MOSFET when it is turned on. While I don't have the exact resistor values inside the debouncing circuit for the 48V signals, I believe that a 1K resistor will allow the gates to see logic low and logic high as it switches. That will consume a bit under 2.5 W when on steadily.
CHASING DOWN ANOMALY WITH PHANTOM RED SHIFT COMMAND
I can see from the output to the terminal that immediately after the emulator box turns on, it believes it has received a Shift to Red command from the 1130. However, the logic in the 1130 is designed to fire off a Shift to Black when it starts up, so this looks like the wires are crossed somewhere in my box.
In point of fact, I had misinterpreted the string of characters - it was actually a shift to black exactly as it should be. No issue.
SWITCHED TO DIRECT PORT ACCESS FOR DIGITALREAD AND DIGITALWRITE
I removed the digitalRead and digitalWrite statements, instead using direct access to ports such as PORTL and PINL. Much faster. Running my code in WokWiki, an online Arduino simulator, it appears to not produce output characters at the maximum rate of 15.5 cps. The simulator web page claims that it runs as fast as the Mega 2560 hardware.
I will need to run some printing software to hit the maximum rate and check to see if any characters get dropped. If there is a speed problem, I will have to get even more clever to meet the timing requirements.
If port commands hurt your eyes and make code unreadable - use digitalwritefast.
ReplyDeletehttps://github.com/ArminJo/digitalWriteFast
I like it because the PIN numbers stay readable and you can simply replace all the calls.