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