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