Ruud's Commodore Site: Debugger-LPT Home Email

Debugger-LPT / Arduino





What is it?

The Debugger-LPT enables you to observe the behaviour of various processors step by step. It is based on the Debugger but in contrast with it, the Debugger-LPT is controlled by the printer port of a PC or an Arduino.


The story

My original debugger has three disadvantages:
  • The used intelligent 7-segment displays aren't cheap.
  • In quite some situations the display is not well readable due to its position in the system-under-test.
  • In many situations the card is not well accessible due to its position in the system-under-test, for example in a 19 inch rack; I cannot manipulate the switches.
This raised the idea to use a PC to display the content of the display of the debugger. The printer port could serve as the interface between the card and the PC. But nowadays LPT ports are becoming rare. So the idea rose to use an Arduino Uno R3 or Mega2560 to do the job as well.


Schematics

The design with logic gates instead of a GAL
The design with a GAL
The board of the above design



Picture




On forehand: bugs and other imperfections

- Only when I received the PCB I noticed the types of the ICs are missing. So you have to look at the board to find out what IC is what.


The above will be repaired in the future.


The hardware

Please read Debugger first because it explains almost everything how this card will work.
The idea is quite simple: discard of all 7-segment displays and replace all switches with the outputs of a 573 latch.

As you know, there exist several versions of the printer port: undirectional (the original printer port), bidirectional (also known as PS/2 printer port), EPP and ECP. EPP and ECP are just bi-directional with extra fuctions which are not needed in this case.
The LPT ports of most PCs with an onboard LPT port, read: LPX, ATX boards or better, are bi-directional. I would also need more parts for my card if I want to connect it to an unidirectional port. So this design is for a bi-directional LPT port only. And for the Arduino of course.

This schematic explains how the Debugger-LPT will work. The actual design uses a GAL20V10 instead of the various gates, switches and 138 de-multiplexer.

Two 573's, IC3 and IC5, replace the two 8-bit dipswitches and another 573, IC4, replaces all other switches. The data coming from the data bus of the LPT port or Arduino, is clocked into the IC by a 138 (IC11), 3-to-8 demultiplexer, through some inverters, IC12A, B and C.
The 138 is also used to select the 573 whose data we want to read:
- IC8 for the data bus
- IC7 for the low byte of the address bus
- IC6 for the high byte of the address bus
The 138 is directed by the four outputs, pin 1, 14, 16 and 17, of the LPT port.
The left site of the design is the same as the one of the original Debugger

As already mentioned in Debugger, three free input lines of the LPT port enabled me to monitor three extra lines of connector CON1. I chose R/W, IRQ and NMI.


Using an Arduino

The LPT port is nothing more then a bunch of in and output ports. In case of the data lines, they are even bi-directional. So any processor controlled system that can mimic these lines can be used to control this device. IMHO even a Commodore 64 with an extra 6526 CIA can do that.
But we also must be practical. One computer that came to my mind is the Raspberry Pi but this device has one disadvantage: its I/O part only supports 3.3V I/O lines so converters would be needed. An Arduino is 5 Volt all over and doesn't have this advantage. OK, the UNO R3 cannot store big programs and has only 2 KB of RAM. But my intention is that it only serves as interface between the Debugger-LPT and any PC with an USB port.


The GAL

	Name		-- DebuggerLPT --;
	Device		G22V10;
	Designer	Ruud Baltissen;
	Date		2021-05-09;
	Revision	V0.1;

	Assembly	--;
	Company 	--;
	Location	--;
	Partno 		--;

    
/* Define Logic Operators */
	/* AND = &  */
	/* OR  = #  */
	/* NOT = !  */     
	/* XOR = $  */     


/* Define Input Pins */
pin  1  = GALCLK;	/* clock input, not used */
pin  2  = EnaStep;	/* enable stepping */
pin  3  = Step;		/* stepping signal */
pin  4  = LPT1;		/* Strobe */
pin  5  = LPT14;	/* Auto feed */
pin  6  = LPT16;	/* Initialize */
pin  7  = LPT17;	/* Select in */
pin  8  = BA;		/* Bus available */
pin  9  = CLK;		/* CLK2 */
pin  10 = NQA;		/* output Not Q, flipflop A */
pin  11 = QB;		/* output Q, flipflop B */
pin  13 = A688;		/* output Address discriminator */


/* Define Output Pins */
pin  14 = CLK573;	/* clock signals for outgoing 573s */
pin  15 = DataB;	/* data input flipflop B */
pin  16 = ClkB;		/* clock input flipflop B */
pin  17 = OeAL;		/* Output Enable Addres Low IC7 */
pin  18 = ClkADL;	/* Clock Address Discriminator Low IC5 */
pin  19 = OeAH;		/* Output Enable Address High IC6 */
pin  20 = ClkADH;	/* Clock Address Discriminator IC3 */
pin  21 = OeDa;		/* Output Enable data IC8 */
pin  22 = RDY;		/* Ready signal on Elektor bus */
pin  23 = ClkSw;	/* Clock 573 Switches IC4 */
		
		
		
/* Boolean Equations */
CLK573	= CLK & BA;
DataB	= Step & NQA;
ClkB	= !CLK;
RDY	= A688 & (QB # EnaStep);
ClkSw	=  LPT17 & !LPT16 & !LPT14 & !LPT1;
ClkADL	=  LPT17 & !LPT16 & !LPT14 &  LPT1;
ClkADH	=  LPT17 & !LPT16 &  LPT14 & !LPT1;
OeDa	= !LPT17 # !LPT16 #  LPT14 #  LPT1;
OeAL	= !LPT17 # !LPT16 #  LPT14 # !LPT1;
OeAH	= !LPT17 # !LPT16 # !LPT14 #  LPT1;



The software

Still working on it....





Having questions or comment? You want more information?
You can email me here.