It seems it doesn't work
The LPT is set to EPP and the wiring scheme I adopted is the following:
LPT pin T6963
17 ----> RD
16 ----> C/D
14 ----> CE
1 ----> WR
2 to 9 --> D0 to D7
According to the OPTREX DMF-5002 user manual to read the status of the T6963C I should set: (I report exactly as it written on the manual)
RD="L", C/D="H": Status Read, C/D="L": Data Read
it's not clear when I must set the C/D=L, prior to read the D0-D7 or after.
Anyway in my program I tried this (sorry it's Delphi but I think is understandable)
portwriteb($378,0) // set the data lines to 0 to avoid dirty data
portwriteb($378+2, $04) // RD=0, C/D=1
tmp:= portreadb($378) // read D0-D7
portwriteb($378+2, $00) // RD=0, C/D=0
in this case the status (tmp) value is 0.
If I modify the code as follows:
portwriteb($378,0) // set the data lines to 0 to avoid dirty data
portwriteb($378+2, $04) // RD=0, C/D=1
portwriteb($378+2, $00) // RD=0, C/D=0
tmp:= portreadb($378) // read D0-D7
the result is the same: tmp=0
I found another document about T6963C programming reporting this:
Status Read: C/D=1, R/D=0, W/R=1, CE=0
after 150 ns read the data D0-D7 then CE=1
I modified the code as follows then:
portwriteb($378,0);
portwriteb($378+2, $05); // RD=0, C/D=1, CE=0, WR=1
tmp:= portreadb($378);
portwriteb($378+2, $07); // RD=0, C/D=1, CE=1, WR=1
the status (tmp) also in this case is 0.
At this point I'm confused and I don't know what is the correct way to read the status.
If it was all correct, it sounds strange to me that the status is always 0.
I see there is a pin on the T6963C named /HALT (active low, stop the oscillation clock) that I connected to +5V...is that correct?
Someone can help to clarify things?
Thanks, regards.
Bob