Solution:
====Question====
In the following program, the printer status reported by system is different
between PCA-6144V and PCA-6145L. Why?
> sample.c
#include
#include
#define _BIOS_IBMPC
#include
#define STATUS 2 /* ?????????? */
#define PORTNUM 0 /* LPT1 ????? */
int main(void)
{
int status, abyte = 0;
printf("????????????????????????\n");
getch();
status = biosprint(STATUS, abyte, PORTNUM);
if (status & 0x08)
printf("I/O ??\n");
return 0;
}
====Answer====
Please read the attachment first. The function call - "biosprint()" in C
language is to call INT 17h (BIOS interrupt call). And the INT 17h read the
"printer status" from "status port" of onboard super I/O chip. You customer
got the bit 3 (D3 /PD3) via "biosprint() " and check if there is an error
having been detected. The most important point is - the ERROR signal must be
provided by a printer (see description of pin functions). If this is floating
(no connection), the signal of this pin may be any state (it depends on super
I/O chip) and it doesn't mean any thing. I have made a table as following, it
tells you how the "I/O error" message is transmitted from printer port to C
language.
State:
Printer - error pin High Low Not connect to the printer port
Super I/O printer port - error pin High Low Maybe High or Low or tri-state. (it
depends on I/O chip)
Super I/O status port - error bit High Low Corresponding to super I/O printer port
- error pin.
INT 17 - BIOS call (the error bit is inverted by INT 17) Low High Corresponding to
status port - error bit.
biosprint() Low High Corresponding to INT 17 return value
We don't know why your customer check the error bit without connecting a
printer, but please tell your customer the error bit should be used while
connecting a printer to print port because the signal needs be provided by
printer.
|