paul@6 | 1 | The Am29F010-90PC product has been used to test the software and hardware
|
paul@6 | 2 | design described here.
|
paul@6 | 3 |
|
paul@0 | 4 | Pins
|
paul@0 | 5 | ====
|
paul@0 | 6 |
|
paul@0 | 7 | A0-A16 17-bit addressing
|
paul@0 | 8 | DQ0-DQ7 8-bit data transfer
|
paul@0 | 9 | CE# chip enable
|
paul@0 | 10 | OE# output enable
|
paul@0 | 11 | WE# write enable
|
paul@0 | 12 | VCC 5V
|
paul@0 | 13 | VSS ground
|
paul@0 | 14 | NC (not connected)
|
paul@0 | 15 |
|
paul@0 | 16 | Low-Level Operations
|
paul@0 | 17 | ====================
|
paul@0 | 18 |
|
paul@0 | 19 | CE# high standby
|
paul@0 | 20 | CE# low read, write or output disable
|
paul@0 | 21 |
|
paul@0 | 22 | OE# high, WE# high output disable
|
paul@0 | 23 | OE# low, WE# high read
|
paul@0 | 24 | OE# high, WE# low write
|
paul@0 | 25 |
|
paul@0 | 26 | Thus, for reading and writing:
|
paul@0 | 27 |
|
paul@0 | 28 | OE# = not WE#
|
paul@0 | 29 |
|
paul@0 | 30 | Timing
|
paul@0 | 31 | ======
|
paul@0 | 32 |
|
paul@0 | 33 | Addresses are latched on the falling edge of the latest of WE# and CE#
|
paul@0 | 34 | Data is latched on the rising edge of the latest of WE# and CE#
|
paul@0 | 35 |
|
paul@0 | 36 | Strategy:
|
paul@0 | 37 |
|
paul@0 | 38 | 1. Start with CE#, OE#, WE# high (standby, output disable)
|
paul@0 | 39 | 2. Bring CE# low (output disable)
|
paul@0 | 40 | 3. Set addresses
|
paul@0 | 41 | 4. Bring WE# or OE# low for operation (write or read)
|
paul@0 | 42 | 5. Read or write data
|
paul@0 | 43 | 6. Bring WE# or OE# high (output disable)
|
paul@0 | 44 |
|
paul@0 | 45 | Operation Modes
|
paul@0 | 46 | ===============
|
paul@0 | 47 |
|
paul@0 | 48 | By default, the device is in read mode, meaning that merely bringing OE# low
|
paul@0 | 49 | will produce data for the asserted address.
|
paul@0 | 50 |
|
paul@0 | 51 | To issue commands to change the mode involves write operations with specific
|
paul@0 | 52 | address and data arguments.
|
paul@0 | 53 |
|
paul@0 | 54 | Sectors
|
paul@0 | 55 | =======
|
paul@0 | 56 |
|
paul@6 | 57 | A[16...14] selects each 16KB sector and is referred to as the sector address
|
paul@6 | 58 | or SA in the documentation.
|
paul@0 | 59 |
|
paul@0 | 60 | Commands
|
paul@0 | 61 | ========
|
paul@0 | 62 |
|
paul@3 | 63 | Reset (A=$5555; D=$AA); (A=$2AAA; D=$55); (A=$5555; D=$F0)
|
paul@6 | 64 |
|
paul@6 | 65 | Autoselect (manufacturer) (A=$5555; D=$AA); (A=$2AAA; D=$55); (A=$5555; D=$90);
|
paul@6 | 66 | (A=$X00; read)
|
paul@0 | 67 | => D=$01
|
paul@6 | 68 |
|
paul@6 | 69 | Autoselect (device) (A=$5555; D=$AA); (A=$2AAA; D=$55); (A=$5555; D=$90);
|
paul@6 | 70 | (A=$X01; read)
|
paul@0 | 71 | => D=$20
|
paul@0 | 72 |
|
paul@6 | 73 | Simple reset (A=$XXXX; D=$F0)
|
paul@6 | 74 |
|
paul@6 | 75 | Sector erase (A=$5555; D=$AA); (A=$2AAA; D=$55); (A=$5555; D=$80);
|
paul@6 | 76 | (A=$5555; D=$AA); (A=$2AAA; D=$55); (A=SA; D=$30)
|
paul@6 | 77 |
|
paul@6 | 78 | Program (A=$5555; D=$AA); (A=$2AAA; D=$55); (A=$5555; D=$A0);
|
paul@6 | 79 | (A=PA; D=PD)
|
paul@6 | 80 |
|
paul@6 | 81 | Progress
|
paul@6 | 82 | --------
|
paul@6 | 83 |
|
paul@6 | 84 | Programming and erasure commands employ data pins as follows:
|
paul@6 | 85 |
|
paul@6 | 86 | Programming Erasure
|
paul@6 | 87 | DQ7 On completion: DQ7-out On completion: 1
|
paul@6 | 88 | DQ6 During: toggling value During: toggling value
|
paul@6 | 89 | DQ5 On failure: 1 On failure: 1
|
paul@6 | 90 | DQ3 Sector erase begun: 1
|
paul@6 | 91 |
|
paul@6 | 92 | A read operation is required to obtain these outputs, typically with the same
|
paul@6 | 93 | address used to initiate each operation.
|
paul@0 | 94 |
|
paul@0 | 95 | Arduino Interfacing
|
paul@0 | 96 | ===================
|
paul@0 | 97 |
|
paul@0 | 98 | Arduino can employ at most 14 digital pins, whereas the Am29F010B requires 17
|
paul@0 | 99 | address pins, 8 data pins, plus 3 control pins to be utilised.
|
paul@0 | 100 |
|
paul@0 | 101 | One solution is to map the 3 control pins directly to the Arduino, then to
|
paul@0 | 102 | channel address and data via 8 common pins to latches, and then employ the
|
paul@0 | 103 | remaining pins to control the latches.
|
paul@0 | 104 |
|
paul@2 | 105 | Two pins can be used to select the latches, and when neither latch is
|
paul@2 | 106 | selected, the data pins will be used to read or write data from the flash
|
paul@2 | 107 | memory.
|
paul@0 | 108 |
|
paul@0 | 109 | As a result, only 13 pins are needed on the Arduino.
|
paul@0 | 110 |
|
paul@3 | 111 | Arduino 74HC273 #1 74HC273 #2 Am29F010
|
paul@3 | 112 | ------- ---------- ---------- --------
|
paul@5 | 113 | A5 CE#
|
paul@2 | 114 | 2 OE#
|
paul@2 | 115 | 3 WE#
|
paul@2 | 116 | 4 CP
|
paul@2 | 117 | 5 CP
|
paul@2 | 118 | 6 D0 (*) D0 (*) DQ0
|
paul@2 | 119 | 7 D1 (*) D1 (*) DQ1
|
paul@2 | 120 | 8 D2 (*) D2 (*) DQ2
|
paul@2 | 121 | 9 D3 (*) D3 (*) DQ3
|
paul@2 | 122 | 10 D4 (*) D4 (*) DQ4
|
paul@2 | 123 | 11 D5 (*) D5 (*) DQ5
|
paul@2 | 124 | 12 D6 (*) D6 (*) DQ6
|
paul@2 | 125 | 13 D7 (*) D7 (*) DQ7
|
paul@2 | 126 | Q0 A0
|
paul@2 | 127 | Q1 A1
|
paul@2 | 128 | Q2 A2
|
paul@2 | 129 | Q3 A3
|
paul@2 | 130 | Q4 A4
|
paul@2 | 131 | Q5 A5
|
paul@2 | 132 | Q6 A6
|
paul@2 | 133 | Q7 A7
|
paul@2 | 134 | Q0 A8
|
paul@2 | 135 | Q1 A9
|
paul@2 | 136 | Q2 A10
|
paul@2 | 137 | Q3 A11
|
paul@2 | 138 | Q4 A12
|
paul@2 | 139 | Q5 A13
|
paul@2 | 140 | Q6 A14
|
paul@2 | 141 | Q7 A15
|
paul@2 | 142 | GND A16 (not used)
|
paul@2 | 143 | 5V MR# (**) MR# (**)
|
paul@2 | 144 | 5V VCC VCC VCC
|
paul@2 | 145 | GND GND GND VSS
|
paul@0 | 146 |
|
paul@0 | 147 | (*) Apply pull-down resistor to 74HC273 D inputs when driving using switches.
|
paul@0 | 148 | (**) Apply pull-up resistor to 74HC273 MR# inputs to preserve state.
|
paul@0 | 149 |
|
paul@0 | 150 | 74HC273 Q outputs may initially be high and should be reset, either driving
|
paul@0 | 151 | MR# low or by explicitly latching values onto each device.
|
paul@0 | 152 |
|
paul@0 | 153 | Set Address
|
paul@0 | 154 | -----------
|
paul@0 | 155 |
|
paul@2 | 156 | 74HC273 #1 CP = 1; 74HC273 #2 CP = 0
|
paul@2 | 157 | 74HC273 #1 D[7...0] = A[7...0]
|
paul@2 | 158 | 74HC273 #1 CP = 0; 74HC273 #2 CP = 1
|
paul@2 | 159 | 74HC273 #2 D[7...0] = A[15...8]
|
paul@0 | 160 |
|
paul@0 | 161 | Write Data
|
paul@0 | 162 | ----------
|
paul@0 | 163 |
|
paul@0 | 164 | Configure pins as D[7...0]
|
paul@2 | 165 | WE# = 0
|
paul@2 | 166 | 74HC273 #1 CP = 0; 74HC273 #2 CP = 0
|
paul@2 | 167 | 74HC273 #3 D[7...0] = D[7...0]
|
paul@2 | 168 | WE# = 1
|
paul@0 | 169 |
|
paul@0 | 170 | Read Data
|
paul@0 | 171 | ---------
|
paul@0 | 172 |
|
paul@0 | 173 | Configure pins as Q[7...0]
|
paul@2 | 174 | OE# = 0
|
paul@2 | 175 | 74HC273 #1 CP = 1; 74HC273 #2 CP = 0
|
paul@2 | 176 | Q[7...0] = 74HC273 #0 Q[7...0]
|
paul@2 | 177 | OE# = 1
|