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