View
 

ECB-Centronics

Page history last edited by Wolfgang Kabatzke 9 months, 4 weeks ago

ECB-Centronics R02 is now under development work (finishimg at the end of 01/2015)

 

Parallel Port’s are standardized under the IEEE 1284 standard first released in 1994. This standard defines 5 modes of operation which are as follows,

1. Compatibility Mode.
2. Nibble Mode
3. Byte Mode

The aim was to design a PCB which is compatible with the Standard Parallel Port (SPP). Compatibility, Nibble & Byte modes.

Compatibility mode or "Centronics Mode" as it is commonly known, can only send data in the forward direction at a typical speed of 50 kbytes per second but can be as high as 150+ kbytes a second. In order to receive data, you must change the mode to either Nibble or Byte mode. Nibble mode can input a nibble (4 bits) in the reverse direction. E.g. from device to computer. Byte mode uses the Parallel's bi-directional feature (found only on some cards) to input a byte (8 bits) of data in the reverse direction.

Below is a table of the "Pin Outs" of the D-Type 25 Pin connector and the Centronics 34 Pin connector. The D-Type 25 pin connector is the most common connector found on the Parallel Port of the computer, while the Centronics Connector is commonly found on printers.



(25 PIN D-SUB FEMALE )

Pin No (D-Type 25)

Pin No (Centronics)

SPP Signal

Direction In/out

Register

Hardware Inverted

1

1

nStrobe

In/Out

Control

Yes

2

2

Data 0

Out

Data

 

3

3

Data 1

Out

Data

 

4

4

Data 2

Out

Data

 

5

5

Data 3

Out

Data

 

6

6

Data 4

Out

Data

 

7

7

Data 5

Out

Data

 

8

8

Data 6

Out

Data

 

9

9

Data 7

Out

Data

 

10

10

nAck

In

Status

 

11

11

Busy

In

Status

Yes

12

12

Paper-Out / Paper-End

In

Status

 

13

13

Select

In

Status

 

14

14

nAuto-Linefeed

In/Out

Control

Yes

15

32

nError / nFault

In

Status

 

16

31

nInitialize

In/Out

Control

 

17

36

nSelect-Printer / nSelect-In

In/Out

Control

Yes

18 - 25

19-30

Ground

Gnd

 

 


The above table uses "n" in front of the signal name to denote that the signal is active low. e.g. nError. If the printer has occurred an error then this line is low. This line normally is high, should the printer be functioning correctly. The "Hardware Inverted" means the signal is inverted by the Parallel card's hardware. Such an example is the Busy line. If +5v (Logic 1) was applied to this pin and the status register read, it would return back a 0 in Bit 7 of the Status Register.

The output of the Parallel Port is normally TTL logic levels. 

 

The design of R02 is impressed by the original LPT-Interface of the IBM-PC. We have the same bits, the same structure, ...., only the addresses are in the Z80-address-space....And: it´s an standard LPT-Interface with the only and one extension to use this interface bidirectional. Interrupting is usable via ECB-ModPrn or with John Coffmanns PIC-PCB.....

 

....... more informations are coming soon ....

 

Printing-ECB-Centronics-R02-sch.pdf

 

Printing-ECB-Centronics-R02-brd.pdf

 

 

ECB-Centronics-R01

 

Image: /f/1378379496/Fig0.jpg

 

This PCB is an ECB-PCB to realize a Centronics-Interface for our ECB-System without additional adapters, cables and plugs. The goal was to use an standard-printer with standard Centronics-Interface cable with an SUB-D-25-Connector (like to connect this printer onto an PC) and plug this cable directly into our ECB-system. Not more … And this is absolute user friendly…and GREAT!

 

General

The Centronics interface provides a handshake protocol between a computer and a printer. The maximum data transfer speed depends on the clock rate of the computer system.

Figure 1 show the signals of the Centronics interface.

 

Image: /f/1378235480/ECB-Centronics-image-1.jpg

Fig: 1: signals of the Centronics Interface

 

Signals from computer to printer

 

There are 12 signals from the computer to the printer. Out of these, eight signals are data bits and four signals are control signals. The control signals are:

 

 /STROBE
 /INIT
 /SCLTIN
 /AUTOFDXT

 

All the control signal are “low-active”.

 

 /STROBE   The printer should take the data when this signal is low
 /INIT  When /INIT is low, the printer resets its electronic logic and clears the printer buffer
 /SLCTIN /SLCTIN is an interface enable signal. When this signal is low, the printer responds signals from the controller
 /AUTOFDXT After printing a line, the printer will provide one line feed automatically if this signal is low. This type of line feed is known as hardware line feed

 

Signals from printer to computer

 

There are five status signals from the printer to the computer. Thease are: /ACK, BUSY, PAPER_END, SELECT and /ERROR

 

 /ACK

/ACK-signal is an acknowledgement for /STROBE signal from the computer. When active, it indicates that printer has received data sent by the computer and is ready to accept next byte.

 BUSY  When BUSY is high, it indicates that the printer is busy and it cannot receive data. This signal becomes high under any of the following four conditions
 1: On Receiving /STROBE active
 2: During printing operation
 3: When the printer is in offline state
 4: When the printer sense some error condition

 

 

PAPER_END   When this signal is high, it indicates that there is no paper in the printer. Either the paper is torn or the paper is over.
SELECT

 SELECT signal indicates that there is some error condition in the printer. The three reasons for this signal are:

 1: Mechanical fault or electronic fault in the printer
 2: The printer is in offline state
 3: There is no paper in the printer, i.e. paper-end state

 

 

 

Timing Diagram

 

The timing diagram of Centronics interface protocol is shown in fig 2:

 

Image: /f/1378840054/Fig2.jpg

Fig 2: Timing diagram of Centronics Interface, time stamps are in ns

 

The printer controller send data to the printer. After a minimum gap of 0,5µs, it makes /STROBE low and keeps it low for a minimum duration of 0,5µs. As soon as /STROBE becomes active low, the printer makes BUSY line high. The controller should retain data on the data line for a minimum interval of 0,5µs from the trailing edge of /STROBE. Thus the data should be kept on the data lines for a minimum duration of 1,5µs. When the printer is ready to receive the next character of data, it makes /ACK line low. When /ACK is made inactive, the printer also removes BUSY.

 

Programming Sequence

 

  1. At first the software should verify the logical connection of the printer. For this the computer should send /SELECT_IN signal to the printer. If the printer is powered on and in online mode, it will respond with SELECT signal. If the printer does not send a SELECT signal for a long time, the software should draw the attention of the operator by message.
  2. Before sending data, the printer should be online, error-free and not busy. This can be verified by watching the BUSY signal
  3. When the printer is free, the software can output the data character. After a minimum of 0,5µs delay from sending data, the /STROBE signal should be issued to the printer. As soon as the /STROBE signal is received the printer sets BUSY signal to “high” and it starts taking the data. The printer will analyze the data and determine whether it is a message character to be printed or a control character communicating some control actions to be done by the printer

          Some programs may cause hardware line feed by activation /AUTOFDXT and some programs may cause software line feed by sensing the           line feed control character. If both features are                  

          simultaneously used, the result is then a double line spacing.

     4.  This printer controller as ECB-Board generates NO Interrupt. If there is any interest this feature must be implemented in a new release.

In short the software directly controls the command signals by setting the appropriate bits in the command port. Similarly the status signals are directly sensed by software by reading the status port.

The design of this PCB allows no LOOP Back. That means: Data and Control signals cannot be read back by IN instructions.

 

Image: /f/1378235480/ECB-Centronics-image-4.jpg

 

Figure 3 presents a flow chart for the programming sequence of the Centronics Interface.

 

Data Buffer

 

Usually the printer has a buffer memory to store the characters received from the computer. Hence the printer need not take action for the ASCII-Characters immediately after receiving it. It simply stores the ASCII Character in the buffer memory and immediately issue acknowledgement to the computer by sending /ACK. Due to this, the data transfer to the printer trough the Centronics Interface is done at a faster speed.

Some printers are designed with large buffer memory using RAM IC so that their overall trough-put is quite outstanding. The printer simultaneously does both: printing and receiving data from the computer. When the printer is online it is receiving characters for some  lines.

 

Design strategy

 

The printer controller acts as a buffer interface and as a messenger between the software (program) and the printer.

Observing the protocol sequence and interpreting the status signals are all done by the driver inside the operating system. As shown in Fig. 4 there are three ports:

 

-       Data port

-       Command port

-       Status port

 

 

Image: /f/1378235480/ECB-Centronics-image-5.jpg

 

Fig 4: ports in a simple Centronics printer controller

 

The data port and command port are output ports whereas the status port is an input port. Each port is assigned a unique address that is decoded by a common address decoder as shown in Fig. 5. The data bus transceiver acts as a bi-directional communication path between the system data bus and the three ports. The bits in the control port are issued as the control signals. Ti issue a control signal to the printer the driver uses an OUT instruction for control port address. The data pattern in the CPU-register is entered into the control port. To read the status signals the driver uses an IN instruction for the status port. The status signals are read trough the status ports and stored inside CPU registers. To issue data to the printer the driver uses OUT instruction for the data port. The contents of the CPU register are transmitted to the data lines.

 

 

Image: /f/1378235480/ECB-Centronics-image-3.jpg

 

Fig 5: Functional blocks I a simple Centronics printer controller

 

Realization

 

This ECB-Centronics-PCB is fully decoded and uses 4 I/O-Adresses:

 

Centr-RD-D                read status signals from printer

Centr-WR-C               write control signals to printer

Centr-RD-D                read data (Please be careful, for this function is the internal bit /OE)

Centr-WR-D               write data byte to printer

 

The byte of the data, which are to print, will be latched into IC1. IC2 is the line driver for data information which is latched in IC1. RN2 is use as pull-up-resistor-network to improve the signal behavior.

The control information to realize a handshake with the printer is latched into IC5 (output to printer). IC3A is the line driver. The half RN3 is use as pull-up-resistor-network to improve the signal behavior.

Bit 7 in IC5 is the signal /OE to control the line driver IC2. This eis necessary if You use the Centronics-PCB in Input-mode. Normally and after Reset of the ECB-Computer IC2 is enabled. In this mode IC2 is active. To read data with the help of IC4 You must deactivate the IC2 before You read the data. Otherwise it´s optimal if You use Open-collector circuits to move the input data on to the data line. This is the other reason to implement RN2.

The status information from the printer is read with the help of IC6 into the ECB-computer. The other half RN3 is use as pull-up-resistor-network to improve the signal behavior and the capacitors C9-C13 reduces the noise of the information lines from the printer.

IC3B is used as LED-driver. The LED1-LED3 are shown the state of the control signals /STROBE (to printer), BUSY and /ERROR (from printer). This is sometimes helpful to implement the driver and for testing modes.

IC8, IC9, S1 and RN1 are the parts for the address decoder of this PCB.

S2 is used to select the RESET-signal for the latches. You can use /PWCLR in KONTRON-conform systems or /RESET for N8VEM-SBC.

 

IC2               Bit 0...7          D0...D7

 

IC5               Bit 0              /STROBE

                  Bit 1              /AUTOFDXT

                  Bit 2              /INIT

                  Bit 3              /SELECT_IN

                  Bit 7              /OE

 

IC6               Bit 0              BUSY

                  Bit 1              /ERROR

                  Bit 2              PAPER_END

                  Bit 3              /ACK

                  BIT 4              SELECT   

  

 

Programm code is coming soon later...   

 

Partlist

#

designator

housing

# of type

type

information

1

H3,H4

holes-2,8-PAD

2

 

 

2

C6,C7,C8,C9,C2,C3,C4,C5

C1

8

100n

 

3

C10,C11,C12,C13,C14

C1

5

100p

 

4

R1,R2,R3

R3

3

330

 

5

C1

rcl-E1,8-4

1

47uFT

 

6

RN1

SIL-9

1

8*4,7k

 

7

RN2,RN3

SIL-9

2

8*10k

 

8

P1

19inch-VG96K

1

VG96K

 

9

IC1,IC5

DIP-20__300

2

74LS273N

 

10

IC2,IC4

DIP-20__300

2

74LS245N

 

11

IC3,IC6

DIP-20__300

2

74LS244N

 

12

IC8

DIP-20__300

1

74LS688N

 

13

IC9

DIP-16__300

1

74LS138N

 

14

S1

switch-dil-DIP07YL

1

DIP07YL

 

15

S2

switch-dil-DIP02YL

1

DIP02YL

 

16

D1,D2,D3

LED-3MM

3

LED

 

17

J1

DB25FC

1

DB25

 

 

Circuit

 

ECB-Centronics-R01-sch.pdf

 

PCB

 

ECB-Centronics-R01-brd.pdf

 

Comments (0)