6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Nov 21, 2024 8:04 pm

All times are UTC




Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: Mon Sep 25, 2017 11:06 am 
Offline

Joined: Fri Sep 08, 2017 7:29 pm
Posts: 4
Location: Cork, Ireland
I built a UK101 back in 1980 from a kit and spent quite a while exploring all of it's features over the following years.
I did have a sound card operating and had attached twin floppy drives, via a Floppy controller card, and extended the memory to 40K with a memory card from a project published in Elektor magazine.

I'm retired now for several years and approaching 70 - still full of vigour, thankfully.

Last year, I resurrected it , now stripped back to it's single board again, and got it to work with it's basic 8K ram, by replacing various bits and pieces.

I have built Grant Searle's FPGA based UK01 http://searle.hostei.com/grant/uk101FPGA/index.html , for fun, with the 40k memory expansion based on a single static chip. Brilliant project ! I can now load programs from my PC using, hyperterm.

I looked at his generic FPGA project ( http://searle.hostei.com/grant/Multicomp/index.html ) on how to attach an SD card, for storage, but it seems to be focussed on Z80 only, using CP/M.

Has anybody built the SD card extension to the FPGA UK101 ? And what are the software demands for reading/writing program files ?


Top
 Profile  
Reply with quote  
PostPosted: Mon Sep 25, 2017 11:32 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
Welcome - an excellent choice of first machine! (By which I mean, same as mine.)

I can't help directly with your question, but there are several SD Card projects for Acorn 8-bit micros, with sources available, which might help you if you were try to write your own. These projects bit-bang the interface using a few pins of a VIA, but any parallel port would do. I think my first tactic would be to ping Grant to see if he has any unpublished code to help get started.

See for example
https://github.com/hoglet67/MMFS

Note that there's the question of filesystems - both as to how the data on the card is organised, and how the 6502 accesses the data. In the case of MMFS, the card has a FAT filesystem, with a single file which contains a number of disk images. Once a disk image is selected, the Acorn MOS style of file system is used.

But for a UK101 you don't have a filesystem(*). The very minimal thing to do is to treat the card as a stream of bytes, with no filesystem, and to have just one file on each card. Somewhat like an audio tape. (But there's still work to do: the card is actually organised as blocks.)

(*) Oh, hang on, you had disks attached. So you do have a filesystem! Perhaps you can tweak the filesystem to use the SD Card instead of a disk controller.

Sorry I can't be more helpful... You could also try posting in the off-topic section on StarDot.
http://stardot.org.uk/forums/viewforum.php?f=11


Top
 Profile  
Reply with quote  
PostPosted: Mon Sep 25, 2017 11:44 am 
Offline

Joined: Fri Sep 08, 2017 7:29 pm
Posts: 4
Location: Cork, Ireland
Quote:
(*) Oh, hang on, you had disks attached. So you do have a filesystem! Perhaps you can tweak the filesystem to use the SD Card instead of a disk controller.


I'm afraid 'had' is the operative word. When resurrected, it was in a sad state and while I have a junk box of experimental bits, the controller is long since dissappeared. ( I could search some of the darked receses of my garage :).

Thanks for the info. You have given me a research path.

I will email Grant. I've long admired his projects.


Top
 Profile  
Reply with quote  
PostPosted: Mon Sep 25, 2017 11:45 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
Please share your findings! My experience is that solid state storage makes an enormous difference and has reinvigorated retro computing.


Top
 Profile  
Reply with quote  
PostPosted: Mon Sep 25, 2017 2:33 pm 
Offline

Joined: Sat May 02, 2015 6:59 pm
Posts: 134
Multicomp has hardware support for SD Cards on all three CPU platforms, but no software support on anything but Z80 CP/M.

Another forum member had a go at 6502 SD support a few years back, but I'm guessing life got in the way and progress halted.
It has limited FAT16 support (read only, no directories, 8.3 filenams) so might be starting point.
viewtopic.php?f=2&t=3047


Top
 Profile  
Reply with quote  
PostPosted: Mon Sep 25, 2017 4:11 pm 
Offline

Joined: Fri Sep 08, 2017 7:29 pm
Posts: 4
Location: Cork, Ireland
Good :)
I had spotted that earlier. It has SD reading, orientated towards boot loading.
I've downloaded that to look at it.


Top
 Profile  
Reply with quote  
PostPosted: Mon Sep 25, 2017 4:52 pm 
Offline

Joined: Sat May 02, 2015 6:59 pm
Posts: 134
The boot code from the C-ONE project has some interesting FAT12/16/32 handling code, read only again though.
https://sourceforge.net/projects/c1boot ... oot-alpha/

fat.s from the above archive.
https://pastebin.com/6bwqMjJv


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 26, 2017 7:35 pm 
Offline

Joined: Fri Sep 08, 2017 7:29 pm
Posts: 4
Location: Cork, Ireland
I came across a 65C02 homebrew which uses a SD card for storage. It's a project on Hackaday @

https://hackaday.io/project/5789/logs

He drives the SD card interface from i/o pins of a 6522 PIA (Via?).

He also reveals all source code on the page.

Looking at the code , I got the impression he uses enhanced(?) opcodes from the Cmos version of the 6502.

Boy ! I've now got a mountain to climb to understand all that :)


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 26, 2017 8:03 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
That's a great find! It's not too hard to put in short instruction sequences for a 6502 - especially perhaps if you have a macro assembler. So long as it's not space or timing critical, it's easy.


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 26, 2017 8:55 pm 
Offline

Joined: Sat May 02, 2015 6:59 pm
Posts: 134
That's an interesting project. It's 65C02 code (the CMOS version) as you suspected, which presents a bit of a hurdle. Multicomp uses the T65 core, which has incomplete 65C02 support and won't run the code.
I've never tried substituting a different 6502 core in multicomp, though it's certainly doable, and would probably be easier than rewriting the FAT16 routines for the NMOS 6502.

You'll likely need to adapt sdcard.s to talk to multicomp's SD card interface. You shouldn't need to touch sd_fs.s though.

Finally, you'll need to patch BASIC in order to LOAD from and SAVE to the SD card.
Microsoft BASIC, as used in multicomp is available online as source in a form that can be modified and reassembled.

Create your own Version of Microsoft BASIC for 6502
http://www.pagetable.com/?p=46
https://github.com/mist64/msbasic

Also a good follow up article.
http://www.pagetable.com/?p=774


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 26, 2017 9:03 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
It mightn't be too hard to put a shim around Arlet's core and substitute that into the Multicomp. The advantage being that there's a 'C02 version of Arlet's core. (You need the shim to convert from the core's setup for synchronous RAM to the usual 6502 convention of asynchronous RAM.)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: