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@25 | 4 | Using the Software
|
paul@25 | 5 | ==================
|
paul@25 | 6 |
|
paul@25 | 7 | First of all, to use the Arduino-based programming solution, the Arduino needs
|
paul@25 | 8 | to have a program transferred to it. The program is compiled using the
|
paul@25 | 9 | Makefile provided, using the simple command...
|
paul@25 | 10 |
|
paul@25 | 11 | make
|
paul@25 | 12 |
|
paul@25 | 13 | To upload the program, the "upload" target is used as follows:
|
paul@25 | 14 |
|
paul@25 | 15 | make upload
|
paul@25 | 16 |
|
paul@25 | 17 | It is likely that this will fail unless appropriate permissions are available
|
paul@25 | 18 | on the device through which the Arduino is accessed on the host machine. Thus,
|
paul@25 | 19 | a privileged invocation is likely to be necessary:
|
paul@25 | 20 |
|
paul@25 | 21 | sudo make upload
|
paul@25 | 22 |
|
paul@26 | 23 | Testing the Program
|
paul@26 | 24 | -------------------
|
paul@26 | 25 |
|
paul@25 | 26 | With the program uploaded, it should now be possible to communicate with the
|
paul@25 | 27 | Arduino. Unless the programming circuit has been constructed, however, there
|
paul@25 | 28 | will not be any effect of communicating with the Arduino, other than to check
|
paul@25 | 29 | that the program is operational. Running the upload.py script as follows will
|
paul@25 | 30 | permit such a test:
|
paul@25 | 31 |
|
paul@25 | 32 | ./upload.py -i
|
paul@25 | 33 |
|
paul@25 | 34 | Again, it is likely that this will need to be run in a privileged fashion as
|
paul@25 | 35 | follows:
|
paul@25 | 36 |
|
paul@25 | 37 | sudo ./upload.py -i
|
paul@25 | 38 |
|
paul@25 | 39 | The script should act as a terminal, showing a ">" prompt that can accept
|
paul@25 | 40 | various commands. Merely getting the prompt should be enough of an indication
|
paul@25 | 41 | that the program is functioning on the device.
|
paul@25 | 42 |
|
paul@26 | 43 | Issuing read commands permits the testing of addresses in the device:
|
paul@26 | 44 |
|
paul@28 | 45 | location sector
|
paul@28 | 46 | R0000 0x0000 0 (the first location in the device)
|
paul@28 | 47 | R00000 0x0000 0 (all 17 address bits indicated)
|
paul@28 | 48 | R7fff 0x7fff 1 (the final location in sector 1)
|
paul@28 | 49 | R07fff 0x7fff 1 (all 17 address bits indicated)
|
paul@28 | 50 | R10000 0x10000 4 (the first location in sector 4)
|
paul@28 | 51 | R1ffff 0x1ffff 7 (the final location in the device)
|
paul@26 | 52 |
|
paul@26 | 53 | Uploading and Testing Images
|
paul@26 | 54 | ----------------------------
|
paul@26 | 55 |
|
paul@25 | 56 | Once the programming circuit has been constructed (see "Arduino Interfacing"
|
paul@25 | 57 | below), the upload.py script can be used to upload data to the Am29F010
|
paul@25 | 58 | device. For example:
|
paul@25 | 59 |
|
paul@25 | 60 | sudo ./upload.py jungle.rom
|
paul@25 | 61 |
|
paul@25 | 62 | This will take jungle.rom and write it to the first sector of the Am29F010. To
|
paul@25 | 63 | verify the operation, the following command can be used:
|
paul@25 | 64 |
|
paul@25 | 65 | sudo ./upload.py -v jungle.rom
|
paul@25 | 66 |
|
paul@25 | 67 | To write to other sectors, an option can be specified. For example:
|
paul@25 | 68 |
|
paul@25 | 69 | sudo ./upload.py -s 1 junglecode.rom
|
paul@25 | 70 |
|
paul@25 | 71 | Again, the operation can be verified as follows:
|
paul@25 | 72 |
|
paul@25 | 73 | sudo ./upload.py -s 1 -v junglecode.rom
|
paul@25 | 74 |
|
paul@25 | 75 | Note that the -s option must appear first.
|
paul@25 | 76 |
|
paul@25 | 77 | The upload.py script can accept multiple files and will write each of them to
|
paul@25 | 78 | consecutive sectors. However, it can be more prudent to write files
|
paul@25 | 79 | individually, especially if the circuit is behaving in a less than completely
|
paul@25 | 80 | reliable fashion.
|
paul@25 | 81 |
|
paul@26 | 82 | A Note on Sectors
|
paul@26 | 83 | -----------------
|
paul@26 | 84 |
|
paul@26 | 85 | Each sector is 16 kilobytes long, which corresponds to a 14-bit address range
|
paul@28 | 86 | (0x0000 to 0x3FFF). The Arduino interface described below supports 17-bit
|
paul@28 | 87 | addressing (A0...A16), permitting access to eight sectors (at 0x0000, 0x4000,
|
paul@28 | 88 | 0x8000, 0xC000, 0x10000, 0x14000, 0x18000 and 0x1C000). The simple mapping from
|
paul@28 | 89 | a ROM cartridge to the device leaves A16 grounded and thus unable to access the
|
paul@28 | 90 | upper four sectors in the device. However, A16 could be connected to VCC to
|
paul@28 | 91 | access the upper four sectors.
|
paul@26 | 92 |
|
paul@17 | 93 | Device Compatibility
|
paul@17 | 94 | ====================
|
paul@17 | 95 |
|
paul@17 | 96 | For use with an Acorn Electron ROM cartridge or other board providing a ROM
|
paul@17 | 97 | socket, the compatibility of the Am29F010 needs to be assessed in the context
|
paul@17 | 98 | of the ROM sockets likely to be provided.
|
paul@17 | 99 |
|
paul@17 | 100 | Original ROM Pinout Am29F010 Pinout
|
paul@17 | 101 | ------------------- ---------------
|
paul@17 | 102 |
|
paul@17 | 103 | 1 \/ 32 VCC
|
paul@17 | 104 | A16 2 31 WE#
|
paul@17 | 105 | 1 \/ 28 VCC A15 3 30
|
paul@17 | 106 | A12 2 27 A14 A12 4 29 A14
|
paul@17 | 107 | A7 3 26 A13 A7 5 28 A13
|
paul@17 | 108 | A6 4 25 A8 A6 6 27 A8
|
paul@17 | 109 | A5 5 24 A9 A5 7 26 A9
|
paul@17 | 110 | A4 6 23 A11 A4 8 25 A11
|
paul@17 | 111 | A3 7 22 OE# A3 9 24 OE#
|
paul@17 | 112 | A2 8 21 A10 A2 10 23 A10
|
paul@17 | 113 | A1 9 20 CS# A1 11 22 CE#
|
paul@17 | 114 | A0 10 19 D7 A0 12 21 DQ7
|
paul@17 | 115 | D0 11 18 D6 DQ0 13 20 DQ6
|
paul@17 | 116 | D1 12 17 D5 DQ1 14 19 DQ5
|
paul@17 | 117 | D2 13 16 D4 DQ2 15 18 DQ4
|
paul@17 | 118 | GND 14 15 D3 GND/VSS 16 17 DQ3
|
paul@17 | 119 |
|
paul@17 | 120 | Superimposing the Am29F010 onto a ROM socket would provide compatibility for
|
paul@17 | 121 | all pins from A12 to GND/VSS and from A14 to D3/DQ3.
|
paul@17 | 122 |
|
paul@17 | 123 | Pin 1 in a ROM socket would correspond to A15 but is not necessarily
|
paul@17 | 124 | connected, nor, perhaps, is A14 since only 14 bits are required to address 16
|
paul@17 | 125 | kilobytes, although there may be 32 kilobyte sockets connecting A14 and using
|
paul@20 | 126 | 15 bits to address 32K. A16 and A15 would probably be connected to ground to
|
paul@20 | 127 | ensure correct operation, but could also be wired to a selection mechanism so
|
paul@20 | 128 | that the entire contents of the flash memory might be exposed.
|
paul@17 | 129 |
|
paul@17 | 130 | Pin 28 is a ROM socket would provide power, but the corresponding pin 30 on an
|
paul@17 | 131 | Am29F010 is not connected. Thus pin 30 would need routing to pin 32 for the
|
paul@17 | 132 | flash device socket.
|
paul@17 | 133 |
|
paul@17 | 134 | Pin 31 for the Am29F010 would need to be asserted. Thus pin 30 might also be
|
paul@17 | 135 | routed to pin 31, so that the device would remain read-only at all times.
|
paul@17 | 136 |
|
paul@20 | 137 | Dual ROM Adapter Usage
|
paul@20 | 138 | ======================
|
paul@20 | 139 |
|
paul@20 | 140 | A single Am29F010 device could be wired to two ROM sockets in order to provide
|
paul@20 | 141 | data to both. The above wiring guide would be employed, with connections from
|
paul@20 | 142 | both sockets being connected to the Am29F010, but additional logic would be
|
paul@20 | 143 | required for the CS# signals originating from the sockets in order to expose
|
paul@20 | 144 | the appropriate region of flash memory. ROM #1 would be served by a "lower"
|
paul@20 | 145 | 16K region; ROM #2 would be served by an "upper" 16K region; A14 would be used
|
paul@20 | 146 | to switch between these regions.
|
paul@20 | 147 |
|
paul@20 | 148 | When ROM #1's CS# signal is low, an attempt to read from ROM #1 would be
|
paul@20 | 149 | occurring, and thus A14 would be held low. And when ROM #2's CS# signal is
|
paul@20 | 150 | low, an attempt to read from ROM #2 would be occurring, and thus A14 would be
|
paul@20 | 151 | held high.
|
paul@20 | 152 |
|
paul@22 | 153 | Meanwhile, the CS# signal for the two ROM sockets would need to be combined to
|
paul@22 | 154 | produce a resultant CE# signal for the Am29F010.
|
paul@22 | 155 |
|
paul@22 | 156 | ROM #1 CS# ROM #2 CS# Am29F010 A14 Am29F010 CE#
|
paul@22 | 157 | ---------- ---------- ------------ ------------
|
paul@22 | 158 | 0 0 Not defined Not defined
|
paul@22 | 159 | 0 1 0 0
|
paul@22 | 160 | 1 0 1 0
|
paul@22 | 161 | 1 1 Not defined 1
|
paul@20 | 162 |
|
paul@22 | 163 | It might therefore be possible to connect A14 to ROM #1's CS# signal. And the
|
paul@22 | 164 | resultant CE# signal could be the product of an AND gate:
|
paul@22 | 165 |
|
paul@22 | 166 | Am29F010 CE# = ROM #1 CS# AND ROM #2 CS#
|
paul@22 | 167 |
|
paul@25 | 168 | Wiring Details
|
paul@25 | 169 | --------------
|
paul@25 | 170 |
|
paul@22 | 171 | ROM #1 ROM #2 74HC08 Am29F010
|
paul@22 | 172 | ------ ------ ------ --------
|
paul@22 | 173 | CS# 1A A14
|
paul@22 | 174 | CS# 1B
|
paul@22 | 175 | 1Y CE#
|
paul@25 | 176 | OE# OE#
|
paul@0 | 177 |
|
paul@25 | 178 | ROM (Common) 74HC08 Am29F010
|
paul@25 | 179 | ------------ ------ --------
|
paul@25 | 180 | VCC VCC
|
paul@25 | 181 | GND GND
|
paul@25 | 182 | VCC VCC
|
paul@25 | 183 | VCC WE#
|
paul@25 | 184 | D0 DQ0
|
paul@25 | 185 | D1 DQ1
|
paul@25 | 186 | D2 DQ2
|
paul@25 | 187 | D3 DQ3
|
paul@25 | 188 | D4 DQ4
|
paul@25 | 189 | D5 DQ5
|
paul@25 | 190 | D6 DQ6
|
paul@25 | 191 | D7 DQ7
|
paul@25 | 192 | A0 A0
|
paul@25 | 193 | A1 A1
|
paul@25 | 194 | A2 A2
|
paul@25 | 195 | A3 A3
|
paul@25 | 196 | A4 A4
|
paul@25 | 197 | A5 A5
|
paul@25 | 198 | A6 A6
|
paul@25 | 199 | A7 A7
|
paul@25 | 200 | A8 A8
|
paul@25 | 201 | A9 A9
|
paul@25 | 202 | A10 A10
|
paul@25 | 203 | A11 A11
|
paul@25 | 204 | A12 A12
|
paul@25 | 205 | A13 A13
|
paul@25 | 206 | GND A15
|
paul@25 | 207 | GND A16
|
paul@25 | 208 | GND GND
|
paul@0 | 209 |
|
paul@26 | 210 | Note that A15 and A16 are left grounded, effectively exposing only the first
|
paul@26 | 211 | two sectors of the device. By connecting either or both of these to VCC, other
|
paul@26 | 212 | pairs of sectors can be manually selected. A mechanism could also be devised
|
paul@26 | 213 | to allow selection using logic, but this is not explored here.
|
paul@26 | 214 |
|
paul@0 | 215 | Arduino Interfacing
|
paul@0 | 216 | ===================
|
paul@0 | 217 |
|
paul@28 | 218 | Arduino can employ at most 14 digital pins (plus 5 switchable analogue pins),
|
paul@28 | 219 | whereas the Am29F010B requires 17 address pins, 8 data pins, plus 3 control
|
paul@28 | 220 | pins to be utilised.
|
paul@0 | 221 |
|
paul@0 | 222 | One solution is to map the 3 control pins directly to the Arduino, then to
|
paul@28 | 223 | channel address and data via 8 common pins to latches, and then employ two
|
paul@28 | 224 | remaining pins to control the latches. When neither latch is selected, the
|
paul@28 | 225 | data pins will be used to read or write data from the flash memory.
|
paul@0 | 226 |
|
paul@28 | 227 | In this scheme, A16 must be directly controlled by an additional pin, separate
|
paul@28 | 228 | from the latch-based mechanism. As a result, only 14 pins are needed on the
|
paul@28 | 229 | Arduino.
|
paul@0 | 230 |
|
paul@21 | 231 | 74HC273 Pinout
|
paul@21 | 232 | --------------
|
paul@21 | 233 |
|
paul@21 | 234 | MR# 1 \/ 20 VCC
|
paul@21 | 235 | Q0 2 19 Q7
|
paul@21 | 236 | D0 3 18 D7
|
paul@21 | 237 | D1 4 17 D6
|
paul@21 | 238 | Q1 5 16 Q6
|
paul@21 | 239 | Q2 6 15 Q5
|
paul@21 | 240 | D2 7 14 D5
|
paul@21 | 241 | D3 8 13 D4
|
paul@21 | 242 | Q3 9 12 Q4
|
paul@21 | 243 | GND 10 11 CP
|
paul@21 | 244 |
|
paul@3 | 245 | Arduino 74HC273 #1 74HC273 #2 Am29F010
|
paul@3 | 246 | ------- ---------- ---------- --------
|
paul@5 | 247 | A5 CE#
|
paul@14 | 248 | A4 OE#
|
paul@14 | 249 | A3 WE#
|
paul@14 | 250 | 2 CP
|
paul@14 | 251 | 3 CP
|
paul@27 | 252 | 4 D3 D3 DQ3
|
paul@27 | 253 | 5 D2 D2 DQ2
|
paul@27 | 254 | 6 D1 D1 DQ1
|
paul@27 | 255 | 7 D0 D0 DQ0
|
paul@17 | 256 | 8 D4 D4 DQ4
|
paul@17 | 257 | 9 D5 D5 DQ5
|
paul@17 | 258 | 10 D6 D6 DQ6
|
paul@17 | 259 | 11 D7 D7 DQ7
|
paul@2 | 260 | Q0 A0
|
paul@2 | 261 | Q1 A1
|
paul@2 | 262 | Q2 A2
|
paul@2 | 263 | Q3 A3
|
paul@2 | 264 | Q4 A4
|
paul@2 | 265 | Q5 A5
|
paul@2 | 266 | Q6 A6
|
paul@2 | 267 | Q7 A7
|
paul@2 | 268 | Q0 A8
|
paul@2 | 269 | Q1 A9
|
paul@2 | 270 | Q2 A10
|
paul@2 | 271 | Q3 A11
|
paul@2 | 272 | Q4 A12
|
paul@2 | 273 | Q5 A13
|
paul@2 | 274 | Q6 A14
|
paul@2 | 275 | Q7 A15
|
paul@28 | 276 | A2 A16
|
paul@17 | 277 | 5V MR# MR#
|
paul@2 | 278 | 5V VCC VCC VCC
|
paul@2 | 279 | GND GND GND VSS
|
paul@0 | 280 |
|
paul@0 | 281 | Set Address
|
paul@0 | 282 | -----------
|
paul@0 | 283 |
|
paul@2 | 284 | 74HC273 #1 CP = 1; 74HC273 #2 CP = 0
|
paul@2 | 285 | 74HC273 #1 D[7...0] = A[7...0]
|
paul@2 | 286 | 74HC273 #1 CP = 0; 74HC273 #2 CP = 1
|
paul@2 | 287 | 74HC273 #2 D[7...0] = A[15...8]
|
paul@28 | 288 | Am29F010 A16 = A[16]
|
paul@0 | 289 |
|
paul@0 | 290 | Write Data
|
paul@0 | 291 | ----------
|
paul@0 | 292 |
|
paul@0 | 293 | Configure pins as D[7...0]
|
paul@2 | 294 | WE# = 0
|
paul@2 | 295 | 74HC273 #1 CP = 0; 74HC273 #2 CP = 0
|
paul@2 | 296 | 74HC273 #3 D[7...0] = D[7...0]
|
paul@2 | 297 | WE# = 1
|
paul@0 | 298 |
|
paul@0 | 299 | Read Data
|
paul@0 | 300 | ---------
|
paul@0 | 301 |
|
paul@0 | 302 | Configure pins as Q[7...0]
|
paul@2 | 303 | OE# = 0
|
paul@2 | 304 | 74HC273 #1 CP = 1; 74HC273 #2 CP = 0
|
paul@2 | 305 | Q[7...0] = 74HC273 #0 Q[7...0]
|
paul@2 | 306 | OE# = 1
|
paul@25 | 307 |
|
paul@25 | 308 | Pins
|
paul@25 | 309 | ====
|
paul@25 | 310 |
|
paul@25 | 311 | A0-A16 17-bit addressing
|
paul@25 | 312 | DQ0-DQ7 8-bit data transfer
|
paul@25 | 313 | CE# chip enable
|
paul@25 | 314 | OE# output enable
|
paul@25 | 315 | WE# write enable
|
paul@25 | 316 | VCC 5V
|
paul@25 | 317 | VSS ground
|
paul@25 | 318 | NC (not connected)
|
paul@25 | 319 |
|
paul@25 | 320 | Low-Level Operations
|
paul@25 | 321 | ====================
|
paul@25 | 322 |
|
paul@25 | 323 | CE# high standby
|
paul@25 | 324 | CE# low read, write or output disable
|
paul@25 | 325 |
|
paul@25 | 326 | OE# high, WE# high output disable
|
paul@25 | 327 | OE# low, WE# high read
|
paul@25 | 328 | OE# high, WE# low write
|
paul@25 | 329 |
|
paul@25 | 330 | Thus, for reading and writing:
|
paul@25 | 331 |
|
paul@25 | 332 | OE# = not WE#
|
paul@25 | 333 |
|
paul@25 | 334 | Timing
|
paul@25 | 335 | ======
|
paul@25 | 336 |
|
paul@25 | 337 | According to the datasheet, addresses are latched on the falling edge of the
|
paul@25 | 338 | latest of WE# and CE#, data is latched on the rising edge of the latest of WE#
|
paul@25 | 339 | and CE#.
|
paul@25 | 340 |
|
paul@25 | 341 | Strategy:
|
paul@25 | 342 |
|
paul@25 | 343 | 1. Start with CE#, OE#, WE# high (standby, output disable)
|
paul@25 | 344 | 2. Bring CE# low (output disable)
|
paul@25 | 345 | 3. Set addresses
|
paul@25 | 346 | 4. Bring WE# or OE# low for operation (write or read)
|
paul@25 | 347 | 5. Read or write data
|
paul@25 | 348 | 6. Bring WE# or OE# high (output disable)
|
paul@25 | 349 |
|
paul@25 | 350 | Operation Modes
|
paul@25 | 351 | ===============
|
paul@25 | 352 |
|
paul@25 | 353 | By default, the device is in read mode, meaning that merely bringing OE# low
|
paul@25 | 354 | will produce data for the asserted address.
|
paul@25 | 355 |
|
paul@25 | 356 | To issue commands to change the mode involves write operations with specific
|
paul@25 | 357 | address and data arguments.
|
paul@25 | 358 |
|
paul@25 | 359 | Sectors
|
paul@25 | 360 | =======
|
paul@25 | 361 |
|
paul@25 | 362 | A[16...14] selects each 16KB sector and is referred to as the sector address
|
paul@25 | 363 | or SA in the documentation.
|
paul@25 | 364 |
|
paul@25 | 365 | Commands
|
paul@25 | 366 | ========
|
paul@25 | 367 |
|
paul@25 | 368 | Reset (A=$5555; D=$AA); (A=$2AAA; D=$55); (A=$5555; D=$F0)
|
paul@25 | 369 |
|
paul@25 | 370 | Autoselect (manufacturer) (A=$5555; D=$AA); (A=$2AAA; D=$55); (A=$5555; D=$90);
|
paul@25 | 371 | (A=$X00; read)
|
paul@25 | 372 | => D=$01
|
paul@25 | 373 |
|
paul@25 | 374 | Autoselect (device) (A=$5555; D=$AA); (A=$2AAA; D=$55); (A=$5555; D=$90);
|
paul@25 | 375 | (A=$X01; read)
|
paul@25 | 376 | => D=$20
|
paul@25 | 377 |
|
paul@25 | 378 | Simple reset (A=$XXXX; D=$F0)
|
paul@25 | 379 |
|
paul@25 | 380 | Sector erase (A=$5555; D=$AA); (A=$2AAA; D=$55); (A=$5555; D=$80);
|
paul@25 | 381 | (A=$5555; D=$AA); (A=$2AAA; D=$55); (A=SA; D=$30)
|
paul@25 | 382 |
|
paul@25 | 383 | Program (A=$5555; D=$AA); (A=$2AAA; D=$55); (A=$5555; D=$A0);
|
paul@25 | 384 | (A=PA; D=PD)
|
paul@25 | 385 |
|
paul@25 | 386 | Progress
|
paul@25 | 387 | --------
|
paul@25 | 388 |
|
paul@25 | 389 | Programming and erasure commands employ data pins as follows:
|
paul@25 | 390 |
|
paul@25 | 391 | Programming Erasure
|
paul@25 | 392 | DQ7 On completion: DQ7-out On completion: 1
|
paul@25 | 393 | DQ6 During: toggling value During: toggling value
|
paul@25 | 394 | DQ5 On failure: 1 On failure: 1
|
paul@25 | 395 | DQ3 Sector erase begun: 1
|
paul@25 | 396 |
|
paul@25 | 397 | A read operation is required to obtain these outputs, typically with the same
|
paul@25 | 398 | address used to initiate each operation.
|