home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CBM Funet Archive
/
cbm-funet-archive-2003.iso
/
cbm
/
firmware
/
drives
/
new
/
1541
/
1541C-to-1541-II.txt
< prev
next >
Wrap
Text File
|
2003-06-06
|
11KB
|
300 lines
dOES THE dos-rom OF THE 1541-ii DRIVE RECOGNISE 1541 MECHANICS SUPPORTED
WITH A TRACK 0 LIGHT BARRIER TO MAKE THE DRIVE "RATTLE FREE"?
a LITTLE WRITEUP BY wOLFGANG mOSER, 2003-03-01
2ND CORRECTED EDITION, 2003-03-03
3RD CORRECTED EDITION, 2003-06-06
aS i CHECKED WITH A 1541c DRIVE HARDWARE, THE 1541ii rom DOESN'T CONTAIN
THE PROPER ROUTINES FOR RECOGNISING THE TRACK 0 SENSOR.
i FIRST SUSPECTED THE 1541-ii rom, THAT IT DOES CONTAIN THE
ROUTINES NEEDED, BECAUSE OF THE NEARLY IDENTICAL SERIAL NUMBERS
OF THE BOTH romS:
1541c-251968-02
1541-ii-251968-03
bUT IT DOESN'T. sO WHAT ARE THE DIFFERENCIES OF THE romS REGARDING THE
TRACK 0 LIGHT BARRIER SENSOR. dISASSEMBLING THE romS FOR THE 1541c AND
1541-ii DRIVES AND CHECKING MAINLY FOR THE DIFFERENCIES REGARDING PORT a
OF THE via AT 0X1800...0X180f (PORT a MEANS: 0X1801, 0X1803 AND 0X180f):
EGREP '180(1{$7c}3{$7c}f)' *.D65DIS.ASM
1541-ii.251968-03.D65DIS.ASM: l1801 = $1801
1541-ii.251968-03.D65DIS.ASM: l1803 = $1803
1541-ii.251968-03.D65DIS.ASM:e853 ad 01 18 lda l1801
1541-ii.251968-03.D65DIS.ASM:ff10 8e 03 18 stx l1803
1541-ii.251968-03.D65DIS.ASM:ff50 2c 01 18 bit l1801
1541c_.251968-02.D65DIS.ASM: l1801 = $1801
1541c_.251968-02.D65DIS.ASM: l1803 = $1803
1541c_.251968-02.D65DIS.ASM: l180f = $180f
1541c_.251968-02.D65DIS.ASM:e853 ad 01 18 lda l1801
1541c_.251968-02.D65DIS.ASM:ff10 8e 03 18 stx l1803
1541c_.251968-02.D65DIS.ASM:ff3e ad 0f 18 lda l180f
1541c_.251968-02.D65DIS.ASM:ff41 cd 0f 18 cmp l180f
1541c_.251968-02.D65DIS.ASM:ffa6 2c 01 18 bit l1801
aT 0Xe853 AND 0Xff10 BOTH romS ARE IDENTICAL:
; cLEAR irq-fLAG FOR PORT a, atn_iN AT ca1
e853 ad 01 18 lda l1801
e856 a9 01 lda #$1
e858 85 7c sta l7c
e85a 60 rts
; via PORT INITIALISATION, CALLED FROM eaa0
ff10 8e 03 18 stx l1803
ff13 a9 02 lda #$2
ff15 8d 00 18 sta l1800
ff18 a9 1a lda #$1a
ff1a 8d 02 18 sta l1802
ff1d 4c a7 ea jmp leaa7
tHERE'S A LITTLE DIFFERENCE WITH THE rESET ROUTINE, WHICH CALLS THE PORT
INITIALISATION ABOVE:
; rESET ROUTINE, CALLS PORT INITIALISATION
eaa0 78 sei
eaa1 d8 cld
.IF __1541c__
eaa2 a2 fe ldx #$fe; SET pa0 AS INPUT, pa1.7 OUTPUT
.ELSE
eaa2 a2 ff ldx #$ff; SET paX AS OUTPUT
.ENDIF
eaa4 4c 10 ff jmp lff10; INIT via PORTS
tHE "bit l1801" CAN BE FOUND ON BOTH romS, THEY ARE A PATCH FOR
CORRECTLY CLEARING THE irq-fLAG FOR PORT a, THAT SIGNALS AN atn_iN AT
THE HANDSHAKE INPUT ca1 OF PORT a:
1541c:
ffa6 2c 01 18 bit l1801
ffa9 4c 5b e8 jmp le85b
1541ii:
ff50 2c 01 18 bit l1801
ff53 4c 5b e8 jmp le85b
bUT THERE ARE TWO REMAINING CALLS ("lda l180f" AND "cmp l180f") IN THE
1541c-rom, THAT CANNOT BE FOUND WITHIN THE 1541-ii rom:
; ROUTINE, WHICH CALLS THE FOLLOWING ONE:
fa2e a5 4a lda l4a; MOVE INWARDS
fa30 10 31 bpl lfa63; IF YES, JUMP
fa32 lfa32:; NO, MOVE TOWARDS TRACK 0
fa32 4c 36 ff jmp lff36; CHECK TRACK 0 SENSOR
fa35 lfa35:
fa35 ea nop
fa36 ea nop
fa37 ea nop
fa38 lfa38:
fa38 4c 69 fa jmp lfa69; MOVE TRACK
; ADDED PATCH JUST BEFORE THE ACTUAL "MOVE HEAD" ROUTINE, WHICH FIRST
; CHECKS THE TRACK 0 LIGHT BARRIER AND PREVENTS MOVES TO THE OUTER
; TRACKS, IF A STABLE TRACK-0-CONDITION IS REACHED
ff36 8a txa
ff37 48 pha
ff38 98 tya
ff39 48 pha
ff3a a2 01 ldx #$1
ff3c lff3c:
ff3c a0 64 ldy #$64; WAIT 100 LOOPS AT MAXIMUM
ff3e lff3e:
ff3e ad 0f 18 lda l180f; LOAD PORT a
ff41 cd 0f 18 cmp l180f; CHECK IF BITS ARE STABLE
ff44 d0 20 bne lff66; IF UNSTABLE, JUMP (DO MOVE)
ff46 lff46:
ff46 88 dey; LOOP DOWN
ff47 d0 f5 bne lff3e; AND CHECK AGAIN
ff49 lff49:
ff49 ca dex; LOOP DOWN
ff4a d0 f0 bne lff3c; AND CHECK AGAIN
ff4c lff4c:
ff4c 29 01 and #$1; ISOLATE BIT 0/pa0
ff4e f0 16 beq lff66; IF LOW (TRACKS 1..4X), JUMP
ff50 lff50:
ff50 ad 00 1c lda l1c00
ff53 29 03 and #$3
ff55 d0 0f bne lff66; MOVE HEAD
ff57 lff57:
ff57 a5 7b lda l7b
ff59 d0 0b bne lff66; MOVE HEAD
ff5b lff5b:
ff5b 68 pla
ff5c a8 tay
ff5d 68 pla
ff5e aa tax
ff5f a9 00 lda #$0; DON'T MOVE THE HEAD ONE STEP
ff61 85 4a sta l4a; MORE OUTERWARDS, JUMP BEHIND
ff63 4c be fa jmp lfabe; THE "MOVE HEAD" ROUTINE
ff66 lff66:
ff66 68 pla
ff67 a8 tay
ff68 68 pla
ff69 aa tax
ff6a e6 4a inc l4a
ff6c ae 00 1c ldx l1c00
ff6f ca dex
ff70 4c 38 fa jmp lfa38; JUMP TO "MOVE HEAD" ROUTINE
cOMPARING THE rom OF THE 1541c ADDITIONALLY WITH THE rom OF THE 1571
DRIVE SHOWS, THAT THE "1541 dos rom COMPATIBILITY PART"
(0Xc000...0Xffff) CONTAINS ANOTHER, SLIGHTLY CHANGED ROUTINE FOR A
PROPER TRACK 0 LIGHT BARRIER CHECK:
ff45 98 tya
ff46 48 pha
ff47 a0 64 ldy #$64; WAIT 100 LOOPS AT MAXIMUM
ff49 lff49:
ff49 ad 0f 18 lda l180f; LOAD PORT a
ff4c 6a ror a; PUT bIT 0 INTO THE cARRY
ff4d 08 php; SAVE STATUS
ff4e ad 0f 18 lda l180f; LOAD PART a AGAIN
ff51 6a ror a; AND MOVE bIT 0
ff52 6a ror a; AS SIGN (BIT 7)
ff53 28 plp; GET OLD STATUS
ff54 29 80 and #$80; ISOLATE SIGN
ff56 90 04 bcc lff5c; JUMP, IF FIRST READ =0
ff58 lff58:
ff58 10 1d bpl lff77; MOVE HEAD (TRACK != 0)
ff5a lff5a:; IF BOTH BITS WERE 1,
ff5a 30 02 bmi lff5e; SIGNAL IS STABLE
ff5c lff5c:
ff5c 30 19 bmi lff77; MOVE HEAD, IF SECOND READ =1
ff5e lff5e:
ff5e 88 dey; LOOP DOWN AND CHECK AGAIN
ff5f d0 e8 bne lff49; pa0 FOR STABILITY
ff61 lff61:
ff61 b0 14 bcs lff77; MOVE HEAD, IF pa0 IS STABLE 1
ff63 lff63:
ff63 ad 00 1c lda l1c00; PROBABLY PREVENT HEAD MOVE
ff66 29 03 and #$3
ff68 d0 0d bne lff77; MOVE HEAD
ff6a lff6a:
ff6a a5 7b lda l7b
ff6c d0 09 bne lff77; MOVE HEAD
ff6e lff6e:
ff6e 68 pla; pa0 IS STABLE LOW, FURTHER
ff6f a8 tay; CHECKS WERE DONE.
ff70 a9 00 lda #$0; DON'T MOVE THE HEAD ONE STEP
ff72 85 4a sta l4a; MORE OUTERWARDS, JUMP BEHIND
ff74 4c be fa jmp lfabe; THE "MOVE HEAD" ROUTINE
ff77 lff77:;
ff77 68 pla
ff78 a8 tay
ff79 e6 4a inc l4a
ff7b ae 00 1c ldx l1c00
ff7e ca dex
ff7f 4c 38 fa jmp lfa38; JUMP TO "MOVE HEAD" ROUTINE
tAKE NOTE, THAT THE 1571 ROUTINE PREVENTS AN OUTERWARDS HEAD MOVE, IF
pa0 IS AT A STABLE LOW STATE. tHE 1541c ROUTINE IN CONTRAST PREVENTS THE
HEAD MOVE, IF pa0 IS AT A STABLE HIGH. yOU CAN FIND THE REASON FOR THIS
BEHAVIOUR AT THE ELECTRONICS LEVEL. tHE LIGHT BARRIER SIGNAL IS INVERTED
TWICE (2X 74ls04 INVERTER GATES) ON THE BOARD OF THE 1541c, WHILE IT IS
ONLY INVERTED ONCE (1X 74ls14) WITH THE 1571.
bOTH ROUTINES ARE NOT OPTIMAL IN MY PERSONAL OPINION, BECAUSE THEY DON'T
WORK, IF THERE'S NO LIGHT BARRIER CONNECTED TO THE PORT PIN pa0. tHAT'S
THE REASON, WHY THERE'S AN EXTRA JUMPER ON MOST OF THE 1541c BOARDS
(jp3), WHICH HAS TO BE OPENED TO GET THE TRACK 0 LIGHT BARRIER GO WORK.
tHAT MAY ALSO BE THE REASON, WHY PIN 2 OF PORT a OF THE via IS MOSTLY
CONNECTED TO GROUND ON MOST OF THE 1541-ii MAINBOARDS. pERHAPS EARLY
VERSIONS WERE EQUIPPED WITH A 1541c dos rom, SO THAT THIS "FIX" WOULD BE
NEEDED.
bUT _WHY_ DOES THE rom NOT WORK, IF THE LIGHT BARRIER IS UNCONNECED?
lET'S LOOK AT THE ELECTRONICS FIRST, FIGURE 1 SHOWS THE SIGNIFICANT
PARTS OUT OF THE SCHEMATICS OF THE 1541c MAINBOARD. yOU CAN SEE, THAT
THE PHOTOACTIVE TRANSISTOR OF THE LIGHT BARRIER IS MOUNTED EXTERNALLY,
WHILE THE PULLUP AND THE INVERTERS ARE ON THE 1541c BOARD ITSELF.
+5v
{$7c}
{$7c}
+++
{$7c} {$7c} 47KoHM
{$7c} {$7c} {$7e}{$7e}{$7e}{$7e}{$7e}
{$7c} {$7c} {$7c}
+++ {$7c}
{$7c} +---+ +---+ {$7c}
+--------{$7c} 1 {$7c}o-----{$7c} 1 {$7c}o-------{$7c} pa0
{$7c} +---+ +---+ {$7c}
{$7e}{$7e}{$7e}{$7e}{$7e} {$7c}
{$7e}{$7c}{$7e}{$7e}{$7e} {$7e}{$7e}{$7e}{$7e}{$7e}
{$7c}
\\> {$7c} /
\> {$7c}/
> {$7c}\
{$7c} \
{$7c}
{$7c}
=====
fIG. 1: sIGNAL PREPARATION OF THE 1541c'S TRACK 0 LIGHT BARRIER
tHE PHOTOACTIVE TRANSISTOR IS CONNECTED "oPEN cOLLECTOR", THAT MEANS, IT
CAN ONLY PRODUCE AN ACTIVE LOW SIGNAL. wHENEVER LIGHT FALLS ONTO THE
TRANSISTOR, IT PULLS THE OUPUT LINE TO LOW. iF THE LIGHT BEAM IS BROKEN
(THE HEAD REACHED TRACK 0), THE OUTPUTS BECOMES SOMETHING LIKE AN OPEN
STATE LIKE BEEING UNCONNECTED. tO GET THE INVERTER INPUT SIGNAL HIGH IN
THIS SITUATION WE NEED THE PULLUP RESITOR.
yOU CAN SEE NOW, WHAT HAPPENS, IF THE LIGHT BARRIER IS NOT CONNECTED TO
THE BOARD. tHE DESIRED INPUT LINE IS SIMPLY OPEN, THE SAME AS IF THE
TRANSISTOR BECOMES OPEN, BECAUSE THE LIGHT BEAM IS BROKEN. tHE PULLUP
RESISTOR NOW PUTS THE INPUT SIGNAL TO A HIGH, WHICH "SAYS" TO pa0, THAT
TRACK 0 IS REACHED BY THE HEAD.
rEGARDLESS IF THE LIGHT BEAM IS BROKEN (TRACK 0 REACHED) OR THE WHOLE
LIGHT BARRIER IS NOT MOUNTED OR NOT CONNECTED TO THE BOARD, IT BOTH
MEANS THE SAME: "tRACK 0 REACHED".
aND IF THIS CONDITION BECOMES TRUE, THE rom ROUTINES PREVENTS HEAD MOVES
TO THE OUTERMOST TRACKS. tHAT'S THE REASON, WHY THE HEAD MOVES INWARDS
ONLY, IF YOU SWITCH A 1541c ON AND WANT TO ACCESS IT.
a SOLUTION MAY BE A MORE INTELLIGENT TRACK 0 CHECK ROUTINE, THAT ALSO
MAKES A PROOF, THAT THE TRACK 0 LIGHT BARRIER IS WORKING CORRECTLY. tHAT
MEANS, THAT SUCH A ROUTINE HAS TO CHECK, THAT THE pa0 INPUT SIGNAL
BECOMES LOW SOME TIME, ESPECIALLY, WHEN THE HEAD IS MOVED SOME TRACKS
INWARDS. tHIS TEST COULD BE DONE WITH THE RESET ROUTINE, BUT IT WOULD BE
BETTER TO ALSO INTEGRATE THIS TEST INTO THE STEPPER ROUTINE.
hERE ARE SOME MORE GOALS, THAT SHOULD BE REACHED FOR A FIX OF ALL MODERN
1541 DRIVES, NAMELY THE 1541c AND 1541-ii DRIVES.
1. tHE INPUT SIGNAL SHOULD BE CONNECTED TO THE via INPUT PIN cb2
INSTEAD OF pa0, SO THAT STANDARD PARALLEL CABLES CAN FREELY
USE PORT a (UNTIL KNOW IT IS UNTESTED, IF cb2 IS "FREE" IN A
MANNER, SO THAT IT CAN BE USED FOR THIS PURPOSE).
2. aDDITIONALLY NEEDED ELECTRONICS MUST BE AS SIMPLE AS
POSSIBLE, SO THAT PEOPLE CAN EVEN ADD A LIGHT BARRIER TO
THEIR 1541-ii DRIVES.
3. tHE rom REPLACEMENT SHOULD BE A PATCHED 1541-ii rom AND THE
PATCH MUST BE AS COMPATIBLE AS POSSIBLE TO EXISTING SOFTWARE.
iT WOULD BE BETTER, THE DRIVE "RATTLES" WITH BAD WRITTEN
SOFTWARE INSTEAD OF NOT WORKING IN GENERAL.
4. tHE rom REPLACEMENTS SHOULD WORK IN EVERY CASE, EVEN IF
THERE'S NO LIGHT BARRIER CONNECTED AT ALL. tHIS WOULD BE
FINE, BECAUSE EVERYONE COULD USE THIS rom AS A BASE FOR OWN
PATCHES, IMPROVEMENTS OR ADDONS LIKE SPEEDER SYSTEMS.
5. iT MAY BE ANOTHER GOAL TO PRODUCE A MORE COMPATIBLE 1541 rom
PART FOR THE 1571 DRIVE, WHICH BASES ON THE 1541-ii rom.
tO BE DONE SOMEWHERE IN THE FUTURE, wOMO <WOMO (AT) D81 (DOT) DE>