-
Notifications
You must be signed in to change notification settings - Fork 1
/
story.txt
409 lines (344 loc) · 28.6 KB
/
story.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
[20241028]
Support for D80/D82 disk images (Issue #4). Like with D64/71/81 file-level access is read-only but blocks can be read and written using fast protocol (like GEOS driver does).
[20241019]
Made loader/booter call RESTOR to restore system vector to default. Otherwise they would hang with certain cartridges (e.g. TURBO PLUS) that install hooks to code on page $06xx.
[20241016]
Big batch of v1.3 arrived. Confirmed working. Need to make releases (also for v1.1 revision with correct JED).
Several updates needed:
- separate H/W info from S/W user manual
- new photos
- publish GEOS boot disk
- publish corrected design on pcbway
[20241008]
Proven working with a C16 (6510, EEPROM, expanded to 64K, GAL pla.
[20241007]
Changed switch footprint from the default one to a new one that can be shared between straight and angled push buttons.
J1 (reset passthrough) is open by default - caused Arduino programming failures when passed through CPLD.
[20241001]
Removed 74'00 and reused J3 GPIO connections to check if I can move ROM logic into CPLD and save space and parts.
It's confirmed and tested that it works, so I can start working on rev1.3 with some simplifications.
For reference, bank switching info is here https://plus4world.powweb.com/plus4encyclopedia/500255
[20240928]
GEOS reset vector is supposed to ask for boot disk, then load 'GEOS BOOT' (using Kernal) and jump to $0903.
It doesn't work, but I'm not going to fix that now.
[20240926]
GEOS finally loads and saves! Desk accessories work (because saving/loading of swap files is correct).
The last thing to figure out is what happens at GEOS reset vector. It should just reload desktop.
[20240925]
GEOS finally loads!. There were several problems, but enabled Arduino code was one of them - I have enabled debug but forgot to reduce PATH_SIZE to account for fewer RAM bytes available.
It seems that something related to writing (PutBlock / WriteBuff / WriteFile) doesn't work correctly yet. Saving single sectors was already tested, but when this happens in stream something goes wrong.
TCBM as a single drive #8 is the only one supported now.
Need to figure out what happens at the intercepted GEOS reset vector to recover from that. The message says that it needs bootdisk, but it doesn't even try to access the drive.
[20240922]
Spent last 2 days on disassembling 1551 GEOS disk driver and repacking GEOS. GEOS does boot but tcbm2sd doesn't work yet.
I have to try again with debug Arduino firmware to see what's going on.
[20240919]
Made NEXT button enter the first disk image (providing it's within the first <tries> range (10)).
Tested new Arduino firmware on board without A6/A7 pullups - buttons are enabled until the first reset after powerup.
How this can be prevented without physical mod: adding pullups or shorting A7 to GND I'm not sure.
Tested (within MONITOR) both ROM banks: STA $FDDA for C1LO/HI, STA $FDDF for C2LO/HI. SEI+<copy bytes>+BRK are enough for easy and safe work.
https://plus4world.powweb.com/plus4encyclopedia/500255
[20240918]
Implemented and tested utility functions for block-read and block-write. GEOS will be possible now.
This is disk-image agnostic, so GEOS+4 from .D71/.D81 also is possible.
Read with :U0<$00><track><sector><number-of-blocks-to-read>
Write with:U0<$02><track><sector><number-of-blocks-to-write>
There is a test utility in loader/block-rw.asm that demonstrates how to use it.
Also it has fast protocol for block-write to send data into tcbm2sd.
[20240917]
Fastload made simpler, loader made smaller with 1571/81 burst utility command: U0<$1F><filename>
Within disk images load files by track§or with U0<$3F><track><sector> command
Details: https://www.devili.iki.fi/Computers/Commodore/C1571/firmware/fastutl.html
Bumped minor version to 2 to indicate utility commands are supported.
[20240916]
Added a case for unconnected A6/A7 and saved some RAM by using the same timeout variable for sd_cd and buttons for debouncing.
Next/previous buttons will not make you go out of disk image, will stay on first/last image in directory.
Refactored load/fastload into one huge if/switch/case statement to save flash space.
Go to root folder when SD card is changed.
[20240915]
Fixed JiffyDOS turbo/@$ problems. Turbo loading of directory (withing DBrowser) didn't work because of reversed order of CLRCHN/CLOSE calls when detecting the presence of TCBM2SD in reset string.
@$ listing didn't work because JiffyDOS calls UNTALK/TALK+TKSA after receiving every single line of directory listing. Changed the code to ignore it. Had to add another case for interrupted listing (then it calls LISTEN to close the channel).
Added handler for PREV/NEXT buttons to switch between disk images. It seems a lot more complex than necessary but opening files by directory index doesn't work - it's all relative to root folder and we can't change current folder because we wouldn't be able to go back to parent (see below).
Corrected behavior of DLOAD"* - within disk images it will load the first file from the image, not the embedded boot code.
All of that needs a lot of testing now, with various hardware configurations.
[20240914]
Spent last 3 days trying out various configurations and logic combinations of all the signals available on the cartridge port but nothing would be reliable with 6502.
Finally it occured to me that it's all about the CPU writing to the port and the message I saw too many times when researching the problem: "data is valid on falling clock edge".
Well, guess what - with Fake6523 it's too complex for me to research to care. I found two implementations of 6522 and 6526 and did exactly the same thing they did: use phi0/phi2 as clock and its negedge to clock in data into registers from data bus.
https://github.com/niklasekstrom/cia-verilog/blob/master/cia.v
https://github.com/CompuSAR/6522/blob/main/6522.srcs/sources_1/new/6522.v
*IT WORKED*
The testing revealed everything works except:
+ fastload mode on JiffyDOS with 6502 (dbrowser doesn't load directory, but itself it can be loaded; MOS loader fails); JiffyDOS+7501 works fine; could this be still Arduino firmware issue?
+ @$ on jiffydos, but DIRECTORY works
JED from todays commit c90f487ad7ef8b8be78c856eac885c4cf61f2966 can be used on both v1.1 and v1.2 boards
[20240911]
PCBs arrived (!). The first problem is immediately visible - A6/A7 meant for buttons and TCBM cable sense *are not* digital pins. They need to have external pullups.
[20240904]
Spent the week trying out various logic configurations for tcbm v1.1.
The first fixed issue was that using EEPROM instead of ROM would break loading. Then I got stuck.
Nothing worked for 6502 in fastload mode.
[20240903]
Sent rev 1.2 to production.
[20240825]
Started working on v1.2 revision of the board with all useful signals routed to CPLD.
I left pads for modules unchanged but it should be cheaper (and faster for me as a vendor) to make fab put actual parts on SMD footprints.
Dropped expansion port passthrough idea - no one has those connectors anyway. This freed up space where 32/64K ROM can be placed. But to drive its /CS and A15 we need to combine 4 /CS[1,2][LO,HI] signals. There are no pins left on CPLD so it goes through diodes with pullup (AND) and a SMD 74'00.
Another idea is to add PREV/NEXT buttons and make TCBM connector available. The last pin (16) is a GND, but we will use it to sense if TCBM cable is connected (or PREV button is held down) to decide if Arduino should disable itself.
One more pin goes to SD card. If a real card (not module) socket is used this goes to Arduino.
[20240727]
Corrected disk image code to handle reading from D81 images, that was a bug in the original code.
Changed directory listing code to show disk image files as 'DIR' filetype too.
[20240726]
Patched Directory Browser 1.2 to detect TCBM device (from UI status string) and apply fast protocol if TCBM2SD is detected.
Also implemented fast directory loader. It was only necessary to change a bit the open/close section and redirect CHRIN vector to my routine, nothing else.
[20240725]
DISK IMAGES! THEY WORK!
One can enter disk images with a CD (or with Directory Browser/File Browser too)!
Bumped firmware version to 00,01 because of that.
Restarted work on disk image stuff. Replaced all occurences of String class by plain character arrays.
Removed some unnecessary buffers and replaced local buffers by reusing global ones.
This time it worked correctly.
Still, had to go down with pwd/fullfname buffers from 256 to 72 characters because at least 600 free RAM bytes are needed for stack/heap. Debug will work, but only when buffers are minimal at 24 bytes each.
Would be good to know what takes up most of that RAM.
[20240724]
Reworked PCB to revision 1.1:
- added solder jumpers to choose DEV from +3.3V/GND (hardware control: fixed #8 or #9) or A4 or D1 (serial Rx when A4 is not available)
- TCBM connector as an option, under Arduino because they can't be used at the same time
- removed debug pads
- routed RESET 3.3V from CPLD to Arduino through solder jumper to make it possible to break connection
- removed connection to Arduino pin 3 (some clones have GND there)
- VCC routed with wider trace
- central hole set to 5mm
Prepared manufacturing files for JLCPCB and PCBWay. The one for JLCPCB had to have CPLD chip rotation corrected. I can't find such preview on PCBWay page. But I used their plugin so hopefully everything is fine.
Published project in PCBWay too.
[20240722]
Spent afternoon porting diskimage library from CGTerm. It was not difficult to convert it to read-only operation and to keep only one sector in memory.
Trouble started when this was combined with tcbm2sd code. After adding support for CD (in/out) of image and directory listing (it doesn't skip deleted entries yet) the filename matching procedure doesn't work anymore. I suspect it runs out of RAM. It has to be rewritten.
It's promising - directory listing works and adding support for find&load shouldn't take much flash. But it's disappointing at the same time - these RAM problems will manifest in weird ways in unexpected places. Apart from path handling with Strings everything else is static (I think). It's also possible that debug stuff will break program.
[20240721]
Merged standard transfer procedures: LOAD/STAT/DIR/BROWER into a single function, removed code duplication.
Implemented fastload protocol for DIR, with a test program. Later can be incorporated into DirectoryBrowser.
Replaced embedded browser with a short embedded loader that will fastload '/BOOT.T2SD' from root directory. This way browser can be loaded much faster and users can choose on their own what they want to run for '*' (shift+run/stop). Machine will reset if that file is not found.
It's faster and frees up over 5K for (possible) disk image support (r/o).
Changed the file listing and mapping to mimic sd2iec: if FAT filename is longer than 16 characters then fall back on DOS 8.3 filename with character ~ swapped to <-
Command 'I' reinitializes SD card, so it's possible to handle eject/insert. It can't be detected from the software though. If SD card is missing then 'DRIVE NOT READY' will be reported.
[20240720]
Manufactured another unit. SMD caps are easy, but soldering CPLD by hand is still annoyingly slow.
In the cartridge shell there is no space for any socket under Arduino, it has to be soldered in - even for testing (connection is not reliable). On the other hand, JTAG connector doesn't have to be soldered at all - just pushing it in is enough for flashing JED.
I have solved the problem of flashing Arduino by soldering in female pins from precision socket.
Butchered one cartridge shell to cut a slot on the side for SD card. It extends just enough to grab it with nails or push it in (once I have sockets with eject spring).
[20240719]
People over plus4world.powweb.com make a fair point that sd2tcbm is not that important.
I tend to agree. I was thinking about sd2tcbm because:
- it already handles too long filenames (I can do that)
- it handles SD partitions (meh)
- it probably better handles pattern matching (?)
- it handles disk images (I can do read only)
- fastloaders from 1541 don't matter
Perhaps sd2tcbm is not the right way and I shouldn't spend time on it - a Pi1551 would be more benefit for someone looking for a 1551.
I'm pretty sure I can still stuff in read-only disk image support (for all of them) even if it comes with a cost of not having browser.
[20240718]
Géza Eperjessy kindly shared the source code of DirectoryBrowser! I can't publish it, but I would spin my code into an include file that can remain public reference.
[20240714]
Implemented embedded browser load when '*' file is requested. It can be started with SHIFT+RUN/STOP.
Implemented last useful disk commands: R, MD, RD.
Almost at the end of flash space, but everything I wanted to have is in.
That took exactly one month.
[20240713]
Success! 23x! (220 blocks in 6 seconds = 9300b/s = 23x 1541, almost 6x 1551)
Wrote a new state function with fastload code. The +4 side doesn't look like Warpload at all anymore. I had to add status checking in proper place as well as ACK signaling that data was read.
It worked already on the first try, needed only some tweaks related to +4 code and cleanups.
Directory Browser doesn't respond well to exomizer and pucrunch - decrunched is not able to run loaded programs.
TODO:
+ (if enough flash) store browser with fastload inside flash, load with '**' magic name OR just '*' - SHIFT+RUN/STOP (even better!)
+ convert assembled db12b.prg into C array and include into Arduino code (xxd -i db12b.prg -> db12b_prg , db12b_prg_len + trzeba do tego dodac static const PROGMEM, można w linii tuż przed #include)
+ pass to STATUS with pointer
+ (low priority) 'R' command
[20240712]
Disassembled parts of Directory Browser 1.2 and Warpload turboloader. Wrote a patch on DB 1.2 that should work as a turboloader. A lot of Warpload pieces are not necessary because it's a load wedge, so it has to check for status, if file is '$' and print LOADING/SEARCHING messages.
TODO:
+ (if enough flash and sources to any browser are available): fastloader over parallel port with switching direction back an forth
[20240711]
Investigated how fastloaders work on Plus4. A lot of them are just turboloaders for 1541. Those for 1551 do mostly the same thing - use DAV (from drive) as handshake lines and (because there is no hardware handshake) check for level change. They don't use ACK (to drive) and rely on 1551 not pushing data too fast. Also they don't mask out unused bits from port C (STATUS), that's a risk here.
Because of the timing thing I can't make tcbm2sd compatible with any of the existing loaders, I would have to rely on delays, sacrificing reliability or speed.
[20240710]
Removed redundant delays when reading data. Put all uncommented debug messages within "if (debug) { }" - compiler with optimize them away and it's nicer than #ifdef. This saves about 1500 bytes of flash.
[20240709]
It's done and ready. Last few changes wee to port this code to use SdFat. It enabled long names and is much faster with directory operations. It has chdir() but it's useless without an option to go to parent directory.
All the letters are converted to lowercase PETSCII (0x41-0x5x) for consistency. (Also Directory browser chokes on 0x61-0x7x ASCII).
Longnames are compared up to 16 characters, but the internal buffers have 128 bytes (otherwise SdFat won't render the name).
LOAD,CD,SCRATCH will all use absolute path if the name starts with '/'. For LOAD it works only for short names but can be useful to load something from the root folder.
There is no hope of supporting both devices on the bus - DEV (A5) would be activated only when registers are accessed, without a latch this will be lost and we don't know what to latch.
So instead only Micro will set DEV. The value is stored in EEPROM (with default value 8) and can be changed with standard command "U0>"+chr$(dev) (dev=8,9).
The measured speed is about 3.1KB/s, about 7.5x 1541 (401B/s).
Now it can be published. Published without pictures/readme. Need to credit Open264cart, LittleSixteen and Fake6523 and point to Open264cart case on thingyverse.
TODO-HW
+ 5mm hole in the middle
+ comments about ACK/DAV on schematic, no signal name change
[20240708]
Back to CPLD/Verilog. I'm not sure what I'm doing but none of the changes helped except trying to replicate F7->I0 feedback. ISE now gives warning about race condition but the circuit is much more stable.
(no, removing MUX from MUX||!MUX or leaving just Phi0&!RAS didn't help at all).
I have updated comments and direction of DAV/ACK. This needs to be reflected as labels on schematic too.
There is now full address decoding so we occupy only 8 I/O bytes.
Arduino doesn't mind 5V reset but for the next PCB revision /RESET is copied to pin 44.
I have corrected comments about device number, now it makes sense.
I can almost release it (again). Two last things are needed: longnames and device number control.
For publishing *I have to* follow Jim Brain's license for Fake6523: LICENSE_CC_BY_SA_4.0.txt
TODO:
+ use SdFat library for long names (same interface? almost, but it has chdir() so we don't need to track pwd!) [if it works factor out pwd] [check if topetscii is needed]
+ take device number from EEPROM ($55/$AA (magic) + $00 or $01) upon reset
+ write new device to eeprom as a number after standard 1571/SD2IEC command U0>+chr$(8)/9; apply to DEV immediately
[20240707]
Completed filename pattern matching. Directory listing will show current directory name as volume label.
Command has to be executed right after UNLISTEN, like on IEC. The CLOSE command may not come at all (it does from BASIC and from File Browser, not from Directory Browser).
Filename pattern matching function returns filename. It's easier, besides SD.exists() is very fast, much faster than going through directory with openNextFile (this is noticeably slow).
There are some random hangups with directory loading within Directory Browser or file loading from File Browser. Trying to add some delays may help a bit, but not 100% (unless it's big delay?). Not sure whether the problem is within Micro or CPLD/PLA code.
Everything works fine from BASIC though.
- PLA16 replacement for MOS 251641 https://www.freepascal.org/~daniel/c16pla/
TODO-HW
+ resolve DAV/ACK issue (see discord, I think cable is straight) and paddle schematic labels are wrong (how about pagetable article table? is it also wrong?)
+ MiniPro /RESET is tied to 5V? still works, but better route it through CPLD + update logic + normally closeed pcb jumper to disconnect it?
+ correct descriptions: $FEC0-$FECF Floppy 1551, device 9 + $FEF0-$FEFF Floppy 1551, device 8
so DEV=1 means A5=1 && TCBM device 0 == #8
+ why isthere MUX || !MUX? is 'MUX' section needed at all? take logic from PLA16 replacement?
x put fb1615 (1.5) inside flash, load it when '**' is requested; provide URL where it came from
(no space for that, directory browser looks nicer btw; '**' could load some predefined name)
[20240706]
Corrected and completed directory lister and current path stuff for DIRECTORY/DLOAD/DSAVE.
Filebrowser is now completely usable. There is also 'S' command working too and status messages are handled right.
I can almost release it. Two last things are needed: pattern matching and longnames.
TODO:
+ write own function instead of SD.exists() that would handle filenames trimmed to 16 characters (for future long names) and pattern matching of '*' and '?'; with a shortcut to SD.exists if there is no pattern needed
+ factor out status messages to a single function that takes error number as input because of several copies of 00, OK, 00, 00
[20240705]
Got SD DLOAD/DSAVE working correctly!!!! Filebrowser works, just needs conforming '$' listing and CD command.
Wrote code for that, untested.
[20240704]
Got DLOAD to work correctly - command bytes always have to be received with status=OK.
All port manipulations now use direct access, much faster.
File-not-found error turned out to be two things: a) have to return to IDLE state immediately (there is no UNTALK, nor CLOSE) and b) because of no CLOSE there was no input buf ptr reset, so the following DIRECTORY (or another DLOAD) was concatenating to current filename.
Now I can go on with SD card stuff!
TODO:
+ write some SD code so that we can finally compute speed - about 3K/s (8x 1541: 401b/s)
+ handle 'S' command (SD library doesn't have rename)
+ how to render directory
+ remove commented out stuff (only after dealing with FILE NOT FOUND - we're missing a byte or two)
[20240703]
Tested code and it mostly works!
Wasted some time on unreliable transmissions but it was all due to non-blocking command read routine that I used within states. It can't be used outside state_idle and I think that since there are no background processes (like button presses/serial/blinking LEDs) I might use blocking version there as well.
Before dealing with SD card basics must be resolved: LOAD ERROR and FILE NOT FOUND.
Input buffer works: OPEN1,8,15,"I1":PRINT#1,"123":PRINT#1,"456" stores whole string I123456 in the buffer for processing command.
DSAVE will work.
DIRECTORY will work.
DLOAD ends with LOAD ERROR; when trying to simulate missing file controller gets it correctly but Micro goes out of sync.
Plus4 resets quicker than Micro is ready. If I hit DIRECTORY quickly it will return junk. Can't see how to block Plus/4 transmission until it's ready.
TODO:
x maybe plus4-too-fast-after-reset problem is also due to missing volatile? (no, it's just bootloader delay)
x LED on/off (OFF in idle state, ON in non-idle) (can't use pin 13 - it's SCK for SD card)
+ test with SD card in slot
+ remove serial input/debug stuff, won't be used anymore
+ what about FILE EXISTS? (nothing not reported after DSAVE except disk error)
+ DSAVE+file exists - can be handled only internally by refusing to save and issuing 63, FILE EXISTS,00,00 error; controller doesn't know about it
+ problems with tcbm_read_cmd may be due to missing volatile clause - check other h/w routines for that
+ test faster port read
+ test fast port DDR change
+ test fast ack/dav/status activity
+ there is a space after first number in status: 00, OK,00,00 : 63, FILE EXISTS,00,00
+ test case for channel 15 it's possible to have LISTEN+SECOND without LISTEN+OPEN with BASIC: OPEN 1,2,15:PRINT#15,"I0"
+ trace byte by byte on emulator how 1551 handles statuses (also what about file exists)
+ why LOAD ERROR? which status is not right (must receive all commands with status=ok)
+ how to resync after file not found? or maybe it should be sent with UNLISTEN? (return immediately to IDLE state)
+ should FILE NOT FOUND be reported to following TALK command after received filename with LISTEN..OPEN? (no, it goes with 1st requested byte)
[20240702]
Untested code for state machine and write transmission. Maybe the state machine is overkill and should only handle directly 2-3 cases (DIRECTORY, DLOAD, DSAVE, DS$, OPEN15,8,15,"CD:xxxx" or whatever would come from DraBrowser)
For faster i/o in the future use direct port access or https://github.com/ArminJo/digitalWriteFast
[20240701]
Updated code. Changed 'TCBM_STATUS_SEND' after data read into TCBM_STATUS_EOI (for byte request) and TCBM_STATUS_OK (for anything else) and now data requests (0x84) come. I'm not sure when/which status should be sent for file not found for DLOAD (it was TCBM_STATUS_SEND, should be _EOI, but when - at UNLISTEN?).
Verified port input function (data from mini-pro).
Logged full examples of DLOAD, DSAVE, DIRECTORY, OPEN+PRINT, OPEN+CLOSE.
Added short data example of a BASIC program to be sent to device (instead of reading from SD).
Tapecart-like functionality is 100% viable, we can go public.
TODO:
- refactor into state machine, split command and command handlers
- possible states
LISTEN + OPEN + filename + UNLISTEN (channel 0 (load) or 1 (save) or 15 (command) only, no support for files)
LISTEN + SECOND + datastream + UNLISTEN (channel 1 (save) or 15 (command) - we won't support files)
LISTEN + CLOSE + UNLISTEN
TALK + SECOND 0 + datastream + UNTALK (channel 0 (load) only, after LISTEN+OPEN 0)
- possible commands:
I - do nothing
CD:<folder> - SD folder change with special cases: / for root and <- ($5f?) for ..
S:<filename> - remove
R:<old>=<new> - rename
[20240630]
That mini-pro module is bricked, after reflashing everything via ISP from a new one nothing changed.
Used a new one, the trick was to change avrdude upload speed to 57600.
After carefully checking what happens with DAV/ACK it looks like they are crossed between paddle and 1551 because the cable pin numbers don't match: DAV is wire 13 in drive, but 11 on paddle. ACK is wire 11 in drive but 13 in paddle.
After swapping DAV/ACK in Arduino (they don't match Kicad at the moment) and after adding INPUT_PULLUP to DAV pin config everything started working.
Additionally set the DEV to 1, seems that is setup for device 8.
This project can be published as-is when DIRECTORY+DLOAD work, so with Tapecart functionality, maybe with 'CD' command to change path. Not a lot will fit into a 328p.
TODO:
+ wait for stabilized command byte
+ serial commands: 0/1/2/3 (set status bits), p <liczba> (set data port out)
+ fewer debug messages
+ reads first transaction byte wrongly - maybe should wait for stable value or check for DAV?
1551 just acks (ACK=0, ACK=1 and goes back to waiting for DAV=1)
+ status lines role is unclear from pagetable description, maybe should trace that in emulator
there is a table but examples use status 10 instead of 00 for 'OK'?
status0 must be pulled 0 in order for plus/4 to detect device
by animation: idle status is 00, goes 10 after receiving unwanted byte
what must happen after 'DLOAD' or 'DIRECTORY' so that controller would request data (at least then we know it must end with status=11 (EOI)
+ didn't test OPEN1,8,2,'TEST123':INPUT#1,A$:CLOSE15
1551 https://github.com/mist64/cbmsrc/blob/master/DOS_1551/io.src
; 4000 / 1 / 2
portc *=*+1 ; port c
; bit 0: status low out -> STATUS0
; bit 1: status high out -> STATUS1
; bit 2: device change port out
; bit 3: handshake line out -> ACK
; bit 4: mode read =1 out
; bit 5: device jumper, dev8=0 in
; bit 6: sync in
; bit 7: handshake line in <- DAV
1551 i/o tcbm
https://github.com/mist64/cbmsrc/blob/master/DOS_1551/it2.src
https://github.com/mist64/cbmsrc/blob/master/DOS_1551/trp.src
[20240629]
Arduino Mini pro 3.3 still can't be flashed. Tried several bootroms. It's possible that is was working all along and now can't start due to wrong fuses (uploading blinker via hex doesn't work).
I should have dumped everything via ISP before doing anything. Maybe will try with another one.
Arduino 168 5v works, but it's severly limited - won't run sd card at all. It's able to check DAV=1, read $81 from the bus and then waits for DAV=0 which never happens.
TODO:
- need to write terminal programs for both ends to check exactly how port behaves (easier than probing)
+ maybe INPUT_PULLUP is needed
- sometimes read $95 or $85 from the bus - is that a problem or just 3.3v vs 5v issue?
+ process may hang because ACK=0 is not recognized on plus/4 side because of missing port bits
+ try with another Mini pro 328p 3.3v, but dump blinker it via ISP first
[20240628]
Tested with just CPLD on Plus/4 - triport appears and stores values in $FEE0-E7. Didn't check if poked values appear in the output though.
Found an arduino mini pro clone for 3.3V but can't flash it.
TODO:
~ check if logic levels appear on the arduino pins (was supposed to come from serial port)
~ flash arduino mini pro with debug code to dump TCBM exchange for 'DIRECTORY' command
- maybe with TL866II+ with new bootloader? ICSP:
https://github.com/blurpy/minipro (sck, miso,mosi etc.)
https://diychris.com/burning-the-arduino-bootloader-using-the-tl866-ii-plus/
https://forum.arduino.cc/t/arduino-nano-bricked/613963/5
https://www.dmcmillan.co.uk/blog/burning-the-arduino-bootloader-to-an-atmega328-with-a-tl866ii
https://docs.arduino.cc/retired/hacking/software/MiniBootloader/
[20240627]
PCBs came. I managed to solder that VQ64 package and 0805 capacitors. Not too easy, not too hard.
Managed to flash CPLD via JTAG from Rpi3
[20240619]
Sent for fabrication. In this setup DEV line is CPLD input (from arduino to indicate which device talks).
In principle arduino can use DEV as input and CPLD can just pass through it from A5.
Ordered also cases (thingiverse 6309306) but the internal post will be for 5mm hole while I reduced it to 4mm due to clearance violations.
[20240617]
Initial git import of tcbm2sd idea.
First development board with ready to use modules: power 3.3v, arduino pro mini to debug bus, sdcard module (passive, based on 3.3v)
hdl code from Fake6523 by Jim Brain
- narrowed down triport to port A (8 bit) port B (2 bit 0-1) and port C (2 bit 6-7)
- integrated PLA 251641-3 equations, except feedback - doesn't seem necessary
[20240614]
Start of the project. Based off a PCB footprint for C264-magic-cart converted from Eagle.
Verified that I can use jtag from Rpi3 (RetroPie)