ArduinoAm29F010

README.txt

19:6eb55ff942e7
2015-01-20 Paul Boddie Added copyright and licensing information.
     1 The Am29F010-90PC product has been used to test the software and hardware
     2 design described here.
     3 
     4 Device Compatibility
     5 ====================
     6 
     7 For use with an Acorn Electron ROM cartridge or other board providing a ROM
     8 socket, the compatibility of the Am29F010 needs to be assessed in the context
     9 of the ROM sockets likely to be provided.
    10 
    11 Original ROM Pinout     Am29F010 Pinout
    12 -------------------     ---------------
    13 
    14                              1  \/  32 VCC
    15                         A16  2      31 WE#
    16      1  \/  28 VCC      A15  3      30
    17 A12  2      27 A14      A12  4      29 A14
    18 A7   3      26 A13      A7   5      28 A13
    19 A6   4      25 A8       A6   6      27 A8
    20 A5   5      24 A9       A5   7      26 A9
    21 A4   6      23 A11      A4   8      25 A11
    22 A3   7      22 OE#      A3   9      24 OE#
    23 A2   8      21 A10      A2  10      23 A10
    24 A1   9      20 CS#      A1  11      22 CE#
    25 A0  10      19 D7       A0  12      21 DQ7
    26 D0  11      18 D6       DQ0 13      20 DQ6
    27 D1  12      17 D5       DQ1 14      19 DQ5
    28 D2  13      16 D4       DQ2 15      18 DQ4
    29 GND 14      15 D3   GND/VSS 16      17 DQ3
    30 
    31 Superimposing the Am29F010 onto a ROM socket would provide compatibility for
    32 all pins from A12 to GND/VSS and from A14 to D3/DQ3.
    33 
    34 Pin 1 in a ROM socket would correspond to A15 but is not necessarily
    35 connected, nor, perhaps, is A14 since only 14 bits are required to address 16
    36 kilobytes, although there may be 32 kilobyte sockets connecting A14 and using
    37 15 bits to address 32K.
    38 
    39 Pin 28 is a ROM socket would provide power, but the corresponding pin 30 on an
    40 Am29F010 is not connected. Thus pin 30 would need routing to pin 32 for the
    41 flash device socket.
    42 
    43 Pin 31 for the Am29F010 would need to be asserted. Thus pin 30 might also be
    44 routed to pin 31, so that the device would remain read-only at all times.
    45 
    46 Pins
    47 ====
    48 
    49 A0-A16      17-bit addressing
    50 DQ0-DQ7     8-bit data transfer
    51 CE#         chip enable
    52 OE#         output enable
    53 WE#         write enable
    54 VCC         5V
    55 VSS         ground
    56 NC          (not connected)
    57 
    58 Low-Level Operations
    59 ====================
    60 
    61 CE# high            standby
    62 CE# low             read, write or output disable
    63 
    64 OE# high, WE# high  output disable
    65 OE# low, WE# high   read
    66 OE# high, WE# low   write
    67 
    68 Thus, for reading and writing:
    69 
    70 OE# = not WE#
    71 
    72 Timing
    73 ======
    74 
    75 Addresses are latched on the falling edge of the latest of WE# and CE#
    76 Data is latched on the rising edge of the latest of WE# and CE#
    77 
    78 Strategy:
    79 
    80  1. Start with CE#, OE#, WE# high       (standby, output disable)
    81  2. Bring CE# low                       (output disable)
    82  3. Set addresses
    83  4. Bring WE# or OE# low for operation  (write or read)
    84  5. Read or write data
    85  6. Bring WE# or OE# high               (output disable)
    86 
    87 Operation Modes
    88 ===============
    89 
    90 By default, the device is in read mode, meaning that merely bringing OE# low
    91 will produce data for the asserted address.
    92 
    93 To issue commands to change the mode involves write operations with specific
    94 address and data arguments.
    95 
    96 Sectors
    97 =======
    98 
    99 A[16...14] selects each 16KB sector and is referred to as the sector address
   100 or SA in the documentation.
   101 
   102 Commands
   103 ========
   104 
   105 Reset                       (A=$5555; D=$AA); (A=$2AAA; D=$55); (A=$5555; D=$F0)
   106 
   107 Autoselect (manufacturer)   (A=$5555; D=$AA); (A=$2AAA; D=$55); (A=$5555; D=$90);
   108                             (A=$X00; read)
   109                             => D=$01
   110 
   111 Autoselect (device)         (A=$5555; D=$AA); (A=$2AAA; D=$55); (A=$5555; D=$90);
   112                             (A=$X01; read)
   113                             => D=$20
   114 
   115 Simple reset                (A=$XXXX; D=$F0)
   116 
   117 Sector erase                (A=$5555; D=$AA); (A=$2AAA; D=$55); (A=$5555; D=$80);
   118                             (A=$5555; D=$AA); (A=$2AAA; D=$55); (A=SA; D=$30)
   119 
   120 Program                     (A=$5555; D=$AA); (A=$2AAA; D=$55); (A=$5555; D=$A0);
   121                             (A=PA; D=PD)
   122 
   123 Progress
   124 --------
   125 
   126 Programming and erasure commands employ data pins as follows:
   127 
   128         Programming                         Erasure
   129 DQ7     On completion: DQ7-out              On completion: 1
   130 DQ6     During: toggling value              During: toggling value
   131 DQ5     On failure: 1                       On failure: 1
   132 DQ3                                         Sector erase begun: 1
   133 
   134 A read operation is required to obtain these outputs, typically with the same
   135 address used to initiate each operation.
   136 
   137 Arduino Interfacing
   138 ===================
   139 
   140 Arduino can employ at most 14 digital pins, whereas the Am29F010B requires 17
   141 address pins, 8 data pins, plus 3 control pins to be utilised.
   142 
   143 One solution is to map the 3 control pins directly to the Arduino, then to
   144 channel address and data via 8 common pins to latches, and then employ the
   145 remaining pins to control the latches.
   146 
   147 Two pins can be used to select the latches, and when neither latch is
   148 selected, the data pins will be used to read or write data from the flash
   149 memory.
   150 
   151 As a result, only 13 pins are needed on the Arduino.
   152 
   153 Arduino     74HC273 #1  74HC273 #2  Am29F010
   154 -------     ----------  ----------  --------
   155 A5                                  CE#
   156 A4                                  OE#
   157 A3                                  WE#
   158 2           CP
   159 3                       CP
   160 4           D0          D0          DQ0
   161 5           D1          D1          DQ1
   162 6           D2          D2          DQ2
   163 7           D3          D3          DQ3
   164 8           D4          D4          DQ4
   165 9           D5          D5          DQ5
   166 10          D6          D6          DQ6
   167 11          D7          D7          DQ7
   168             Q0                      A0
   169             Q1                      A1
   170             Q2                      A2
   171             Q3                      A3
   172             Q4                      A4
   173             Q5                      A5
   174             Q6                      A6
   175             Q7                      A7
   176                         Q0          A8
   177                         Q1          A9
   178                         Q2          A10
   179                         Q3          A11
   180                         Q4          A12
   181                         Q5          A13
   182                         Q6          A14
   183                         Q7          A15
   184 GND                                 A16 (not used)
   185 5V          MR#         MR#
   186 5V          VCC         VCC         VCC
   187 GND         GND         GND         VSS
   188 
   189 Set Address
   190 -----------
   191 
   192 74HC273 #1 CP = 1; 74HC273 #2 CP = 0
   193 74HC273 #1 D[7...0] = A[7...0]
   194 74HC273 #1 CP = 0; 74HC273 #2 CP = 1
   195 74HC273 #2 D[7...0] = A[15...8]
   196 
   197 Write Data
   198 ----------
   199 
   200 Configure pins as D[7...0]
   201 WE# = 0
   202 74HC273 #1 CP = 0; 74HC273 #2 CP = 0
   203 74HC273 #3 D[7...0] = D[7...0]
   204 WE# = 1
   205 
   206 Read Data
   207 ---------
   208 
   209 Configure pins as Q[7...0]
   210 OE# = 0
   211 74HC273 #1 CP = 1; 74HC273 #2 CP = 0
   212 Q[7...0] = 74HC273 #0 Q[7...0]
   213 OE# = 1