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