home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / documentation / documents / a252wd < prev    next >
Text File  |  1999-04-27  |  12KB  |  276 lines

  1.  
  2.                     WD1770/2/3 data (disk controller chip)
  3.                     ======================================
  4.  
  5. This file contains essential data on programming the floppy disk controller
  6. chip used in BBC B+, Master, BBC B with Opus DDOS and some Archimedes
  7. computers.  Please note that a lot of the information in the relevent data
  8. sheet has had to be cut out.
  9.  
  10.  
  11. Register summary
  12. ================
  13.  
  14.   Address offset      Contains on read    on write
  15.   ------------------------------------------------------
  16.          0                 Status         Command
  17.          1                 ------- Track --------
  18.          2                 ------- Sector -------
  19.          3                 ------- Data ---------
  20.  
  21. Command summary
  22. ===============
  23.  
  24.                                Command register bits
  25.   Type  Command            7   6   5   4   3   2   1   0
  26.   -------------------------------------------------------
  27.    I    Restore            0   0   0   0   h   v   r1  r0
  28.    I    Seek               0   0   0   1   h   v   r1  r0
  29.    I    Step               0   0   1   u   h   v   r1  r0
  30.    I    Step in            0   1   0   u   h   v   r1  r0
  31.    I    Step out           0   1   1   u   h   v   r1  r0
  32.    II   Read sector        1   0   0   m  h/s  e  0/c  0
  33.    II   Write sector       1   0   1   m  h/s  e  p/c  a
  34.    III  Read address       1   1   0   0  h/0  e   0   0
  35.    III  Read track         1   1   1   0  h/0  e   0   0
  36.    III  Write track        1   1   1   1  h/0  e  p/0  0
  37.    IV   Force interrupt    1   1   0   1   i3  i2  i1  i0
  38.  
  39.    Where :
  40.    h = motor spin-up sequence disable flag.                  (1770/2 only)
  41.      = 0 Enable spin-up sequence if motor is currently not running.
  42.      = 1 Disable spin-up sequence.
  43.  
  44.    v = verify on destination flag.                           (all)
  45.      = 0 Do not verify
  46.      = 1 Verify (adds a 30 msec head settling time onto command execution)
  47.  
  48.    r1,r0 = head track-to-track stepping rates.               (all)
  49.               r1   r0   1770/3           1772
  50.                0    0    6 ms             6 ms
  51.                0    1   12 ms            12 ms
  52.                1    0   20 ms             2 ms
  53.                1    1   30 ms             3 ms
  54.  
  55.    u = update track register.                                (all)
  56.      = 0 Do not update track register
  57.      = 1 Update track register.
  58.  
  59.    m = multiple sector read/write flag.                      (all)
  60.      = 0 read/write 1 sector only.
  61.      = 1 read/write sectors on current track until command is interrupted
  62.           using the FORCE INTERRUPT command.
  63.  
  64.    s = side compare flag                                     (1773 only)
  65.      = 0 Compare for side 0.
  66.      = 1 Compare for side 1.
  67.  
  68.    a0= data address mark type.                               (all)
  69.      = 0 Write normal data mark.
  70.      = 1 Write deleted data mark.
  71.  
  72.    e = Head settling delay.                                  (all)
  73.      = 0 No delay
  74.      = 1 Add 30 ms delay (15 ms on 1772)
  75.  
  76.    c = Side compare flag.                                    (1773 only)
  77.      = 0 Disable side compare.
  78.      = 1 Enable side compare.
  79.        For all type III commands bit 1 must be 0
  80.  
  81.    p = Write precompensation flag.                           (all)
  82.      = 0 Enable write precompensation.
  83.      = 1 Disable write precompensation.
  84.  
  85.    i3= 1, immediate interrupt.                               (all)
  86.    i2= 1, interrupt on every index pulse.                    (all)
  87.    i1= 1, Ready to not ready transition.                     (1773 only)
  88.    i0= 1, Not ready to ready transition.                     (1773 only)
  89.  
  90.  
  91. Data formats:
  92. =============
  93.  
  94.   Read address.
  95.  
  96.    Byte     Contains
  97.    ---------------------------
  98.     0       Track number
  99.     1       Side number
  100.     2       Sector number
  101.     3       Sector length
  102.     4       CRC check byte (1)
  103.     5       CRC check byte (2)
  104.  
  105.   Write track (format a track)
  106.  
  107.    Double density formats:
  108.    =======================
  109.  
  110.       Recommended      |      Acorn ADFS      |
  111.         format         |     (master 128)     |
  112.    No. of   Hex value  |  No. of   Hex value  |
  113.    bytes    to write   |  bytes    to write   |  Info
  114. -----------------------+----------------------+-------------------------------
  115.      60        4E      |    60        4E      | Post-index Gap      (Gaps 1+2)
  116.   /  12        00      | /  12        00      | Pll lock-up time
  117.   |   3        F5      | |   3        F5      | 3 synchronisation bytes
  118.   |   1        FE      | |   1        FE      | ID address mark
  119.   |   1                | |   1                | Track number
  120.   |   1                | |   1                | Side number
  121.   |   1                | |   1                | Sector number
  122.   |   1                | |   1        01      | Sector length
  123.   |   1        F7      | |   1        F7      | Writes 2 CRC bytes
  124.   |  22        4E      | |  22        4E      | Sector ID / Data Gap  (Gap 3a)
  125.   |  12        00      | |  12        00      | /Write splice time    (Gap 3b)
  126.   |                    | |                    | \Pll lock-up time
  127.   |   3        F5      | |   3        F5      | 3 synchronisation bytes
  128.   |   1        FB      | |   1        FB      | Data address mark
  129.   |   n                | | 256  (5A on format)| Data (number of bytes depends
  130.   |                    | |                    | on the sector length)
  131.   |   1        F7      | |   1        F7      | Writes 2 CRC bytes
  132.   \  24        4E      | \  43        4E      | Post Data Gap          (Gap 4)
  133.     668 approx 4E      |              4E      | Runout Gap. Write until
  134.                        |                      | next index hole.
  135.  
  136.    Single density formats:
  137.    =======================
  138.  
  139.       Recommended     |  Acorn 1770 DFS 2.24 |
  140.         format        |     (master 128)     |
  141.   No. of   Hex value  |  No. of   Hex value  |
  142.   bytes    to write   |  bytes    to write   |  Info
  143. ----------------------+----------------------+--------------------------------
  144.     40        FF      |    40        FF      | Post index Gap       (Gaps 1+2)
  145.  /   6        00      | /   6        00      | Pll lock-up
  146.  |                    | |   3        F5      | 3 synchronisation bytes
  147.  |   1        FE      | |   1        FE      | ID address mark
  148.  |   1                | |   1                | Track number
  149.  |   1                | |   1                | Side number
  150.  |   1                | |   1                | Sector number
  151.  |   1                | |   1        01      | Sector length
  152.  |   1        F7      | |   1        F7      | Writes 2 CRC bytes
  153.  |  11        FF      | |  10        4E      | Sector ID / Data Gap (Gap 3a)
  154.  |   6        00      | |   4        00      | Pll lock-up          (Gap 3b)
  155.  |                    | |   3        F5      | 3 synchronisation bytes
  156.  |   1        FB      | |   1      FB/F8     | Data address mark
  157.  |   n                | | 256  (5A on format)| Data
  158.  |   1        F7      | |   1        F7      | Writes 2 CRC bytes
  159.  \  10        FF      | \  10        FF      | Post data Gap        (Gap 4)
  160.    369 approx FF      |              FF      | Runout Gap. Write until
  161.                       |                      | next index hole.
  162.  
  163.    Write the bracketed area the following times:
  164.  
  165.    Sector length    Sector size (n)     Number of times to write
  166.    -------------------------------------------------------------
  167.          00               128                      ?
  168.          01               256                      16 (ADFS 16, DFS 10)
  169.          02               512                      ?
  170.          03              1024                      5
  171.  
  172.    Notes
  173.  
  174.    1) The gaps can be altered to a minimum of:
  175.             Single density    Double density
  176.       Gap 1      16                 32
  177.       Gap 2      11                 22
  178.       Gap 3a     10                 24
  179.       Gap 3b      4                  8
  180.       Gap 4      10                 16
  181.  
  182.    2) The reliability depends on the gaps. For highest reliability,
  183.       use the recomended formats.
  184.  
  185.    3) The 177X will not automatically detect which density it is use.
  186.       There is usually a separate register or a hard link to set up the
  187.       denstiy. This applies to all commands.
  188.  
  189. Status register.
  190. ================
  191.  
  192.   The meaning of the bits in the status register depends on which type of
  193.   command is currently executing.
  194.  
  195.    Bit |      Type I      |    Type II    |   Type III    | Comments
  196.    ----+------------------+---------------+---------------+-------------------
  197.     7  |    Motor on      | ---------- Motor on --------- | / If bit 3 is
  198.     6  |    Not used.     | -- Disk is write protected. - | | set then:
  199.     5  |  Motor spin-up   |    Data type : 0 = normal.    | | If bit 4 is
  200.        |    completed.    |                1 = deleted.   | | set, the error
  201.     4  | Record not found | ----- Record not found ------ | / is in the ID
  202.     3  |    CRC error.    | --------- CRC error --------- |<  field. If bit 4
  203.     2  |   Not track 0    | ------ Lost data / byte ----- | \ is clear, the
  204.     1  |   Data Request   | -------- Data request ------- | | error is in
  205.     0  |       Busy       | ------------ Busy ----------- | \ the data field.
  206.  
  207.  
  208.   Note that after a reset, some 177X's say that they are busy, when they are
  209.   idle.  This happens when you reset the chip while a command is in progress.
  210.  
  211.  
  212. Read/Write delay times
  213. ======================
  214.  
  215.   There are certain delay times that must be taken into account:
  216.   Operation        Next operation            Delay required
  217.                                           Single    Double density
  218.   ----------------------------------------------------------------
  219.   Write command /  Read busy bit          48 usec   24 usec
  220.   register      \  Read status bits 1-7   64 usec   32 usec
  221.   Write any reg    Read same register     32 usec   16 usec
  222.  
  223.  
  224. Drive control register
  225. ======================
  226.  
  227.   This controls various functions that the 177X is unable to:
  228.  
  229.   Master drive control:
  230.         Bit       Meaning
  231.         -----------------
  232.         7,6       Not used.
  233.          5        Double density select (0 = double, 1 = single).
  234.          4        Side select (0 = side 0, 1 = side 1).
  235.          3        Drive select 2.
  236.          2        Reset drive controller chip.
  237.          1        Drive select 1.
  238.          0        Drive select 0.
  239.  
  240.   B+ drive control:
  241.         Bit       Meaning
  242.         -----------------
  243.         7,6       Not used.
  244.          5        Reset drive controller chip.
  245.          4        Interrupt ?
  246.          3        Double density select (0 = double, 1 = single).
  247.          2        Side select (0 = side 0, 1 = side 1).
  248.          1        Drive select 1.
  249.          0        Drive select 0.
  250.  
  251.   Opus double density board on BBC:
  252.         Bit       Meaning
  253.         -----------------
  254.         7         Not used.
  255.         6         Density select (0 = single, 1 = double).
  256.         5-2       Not used.
  257.         1         Side select (0 = side 0, 1 = side 1).
  258.         0         Drive select (0 = drive 0, 1 = drive 1).
  259.  
  260.   Note that only 1 drive select bit line should be set at a time.
  261.  
  262. Addresses of registers:
  263. =======================
  264.  
  265.    Computer        Location of disk chip & chip  Location of drive control
  266.    ---------------------------------------------------------------------
  267.    BBC B with Opus     &FE80 - &FE83    WD1770             &FE84
  268.    BBC B+              &FE84 - &FE87    WD1770             &FE80
  269.    BBC Master          &FE28 - &FE2B    WD1770             &FE24
  270.    Archimedes                ?          WD1772               ?
  271.  
  272.   I am aware that some archimedes used the WD1772 is used, but if anyone
  273.   knows the addresses, I will be happy to put them in.
  274.  
  275.  
  276.