INTRODUCTION
When working with a 15X1 floppy drive, it comes in quite handy to know the track, the drive is currently accessing. This blog presents a kind of drive-modding for 15X1 afficionados.
FEATURES
- SINGLE IC GAL22V10 SOLUTION
- 2 DIGITS LATCHED BCD INTERFACE (0 TO 79)
LET’S GET STARTED
Circuit Description
The State Machine in this logic design waits for an CPU6502 Opcode fetch. If the Opcode and operand match a write to memory location $22 (current track), then the CPU output data is converted to BCD and stored in latches.
Short Instruction
Connect the GAL input signals as listed in the ABEL file to the CPU6502. The BCD outputs can interface with two TIL311 or CD4511 display drivers.
ABEL Design
MODULE
TITLE 'Trackdisplay for CBM 1541 & 1571'
"Yorck Thiele, December 2020
DEVICE 'p22V10';
"INPUTS (CPU6502 SIGNALS)
D0, D1, D2, D3, D4, D5, D6, D7 PIN 2, 3, 4, 5, 6, 7, 8, 9;
PHI2, SYNC, R_W PIN 1, 10, 11;
"OUTPUTS (2 DIGITS BCD)
BCD_UNITS_0, BCD_UNITS_1 PIN 17,18 ISTYPE 'reg';
BCD_UNITS_2, BCD_UNITS_3 PIN 19,20 ISTYPE 'reg';
BCD_TENS_0, BCD_TENS_1 PIN 21,22 ISTYPE 'reg';
BCD_TENS_2 PIN 23 ISTYPE 'reg';
Q0, Q1 PIN 14,15 ISTYPE 'reg';"do not connect
DATA=[D7, D6, D5, D4, D3, D2, D1, D0];
BINARY=[D6, D5, D4, D3, D2, D1, D0];
BCD_TENS=[BCD_TENS_2, BCD_TENS_1, BCD_TENS_0];
BCD_UNITS=[BCD_UNITS_3, BCD_UNITS_2, BCD_UNITS_1, BCD_UNITS_0];
"LATCH ENABLE
LEN=!(Q1 & !R_W);
"STATE DECLARATIONS
sreg = [Q1, Q0];
Idle = [0, 0];
STA = [0, 1];
OPF22 = [1, 0];
MEM22 = [1, 1];
EQUATIONS
BCD_TENS.clk=PHI2;
BCD_UNITS.clk=PHI2;
sreg.clk=PHI2;
"HOLD DATA
when LEN then BCD_TENS := BCD_TENS;
when LEN then BCD_UNITS:= BCD_UNITS;
STATE_DIAGRAM sreg
STATE Idle: if ((DATA==^h85) # (DATA==^h95)) & (SYNC==1) then STA else Idle; "wait for STA-fetch
STATE STA: if DATA==^h22 then OPF22 else Idle; "operand fetch: STA $22 ?
STATE OPF22: if SYNC==0 then MEM22 else Idle; "write cycle; latch enable
STATE MEM22: goto Idle; "hold Q1 high one more PHI2 cycle for proper latching timing
"BINARY TO BCD; FUNCTION ADDS TO HOLD DATA LOGIC
TRUTH_TABLE ([BINARY, Q1, R_W] :> [BCD_TENS, BCD_UNITS])
[ 0, 1, 0] :> [0,0];
[ 1, 1, 0] :> [0,1];
[ 2, 1, 0] :> [0,2];
[ 3, 1, 0] :> [0,3];
[ 4, 1, 0] :> [0,4];
[ 5, 1, 0] :> [0,5];
[ 6, 1, 0] :> [0,6];
[ 7, 1, 0] :> [0,7];
[ 8, 1, 0] :> [0,8];
[ 9, 1, 0] :> [0,9];
[10, 1, 0] :> [1,0];
[11, 1, 0] :> [1,1];
[12, 1, 0] :> [1,2];
[13, 1, 0] :> [1,3];
[14, 1, 0] :> [1,4];
[15, 1, 0] :> [1,5];
[16, 1, 0] :> [1,6];
[17, 1, 0] :> [1,7];
[18, 1, 0] :> [1,8];
[19, 1, 0] :> [1,9];
[20, 1, 0] :> [2,0];
[21, 1, 0] :> [2,1];
[22, 1, 0] :> [2,2];
[23, 1, 0] :> [2,3];
[24, 1, 0] :> [2,4];
[25, 1, 0] :> [2,5];
[26, 1, 0] :> [2,6];
[27, 1, 0] :> [2,7];
[28, 1, 0] :> [2,8];
[29, 1, 0] :> [2,9];
[30, 1, 0] :> [3,0];
[31, 1, 0] :> [3,1];
[32, 1, 0] :> [3,2];
[33, 1, 0] :> [3,3];
[34, 1, 0] :> [3,4];
[35, 1, 0] :> [3,5];
[36, 1, 0] :> [3,6];
[37, 1, 0] :> [3,7];
[38, 1, 0] :> [3,8];
[39, 1, 0] :> [3,9];
[40, 1, 0] :> [4,0];
[41, 1, 0] :> [4,1];
[42, 1, 0] :> [4,2];
[43, 1, 0] :> [4,3];
[44, 1, 0] :> [4,4];
[45, 1, 0] :> [4,5];
[46, 1, 0] :> [4,6];
[47, 1, 0] :> [4,7];
[48, 1, 0] :> [4,8];
[49, 1, 0] :> [4,9];
[50, 1, 0] :> [5,0];
[51, 1, 0] :> [5,1];
[52, 1, 0] :> [5,2];
[53, 1, 0] :> [5,3];
[54, 1, 0] :> [5,4];
[55, 1, 0] :> [5,5];
[56, 1, 0] :> [5,6];
[57, 1, 0] :> [5,7];
[58, 1, 0] :> [5,8];
[59, 1, 0] :> [5,9];
[60, 1, 0] :> [6,0];
[61, 1, 0] :> [6,1];
[62, 1, 0] :> [6,2];
[63, 1, 0] :> [6,3];
[64, 1, 0] :> [6,4];
[65, 1, 0] :> [6,5];
[66, 1, 0] :> [6,6];
[67, 1, 0] :> [6,7];
[68, 1, 0] :> [6,8];
[69, 1, 0] :> [6,9];
[70, 1, 0] :> [7,0];
[71, 1, 0] :> [7,1];
[72, 1, 0] :> [7,2];
[73, 1, 0] :> [7,3];
[74, 1, 0] :> [7,4];
[75, 1, 0] :> [7,5];
[76, 1, 0] :> [7,6];
[77, 1, 0] :> [7,7];
[78, 1, 0] :> [7,8];
[79, 1, 0] :> [7,9]; "max 79 tracks
END